Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken ssh-copy-id after update to 2.29.1 #2873

Closed
1 task done
mhoyer opened this issue Oct 27, 2020 · 3 comments
Closed
1 task done

Broken ssh-copy-id after update to 2.29.1 #2873

mhoyer opened this issue Oct 27, 2020 · 3 comments
Milestone

Comments

@mhoyer
Copy link

mhoyer commented Oct 27, 2020

  • I was not able to find an open or closed issue matching what I'm seeing

See https://github.com/git-for-windows/git/issues?q=is%3Aissue+ssh-copy-id

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.29.1.windows.1
cpu: x86_64
built from commit: e6d53c456169235fe72602e2b4d985934fa9ad23
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18362.1139]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
$ cat /etc/install-options.txt
Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Rebase
Use Credential Manager: Core
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Nothing special

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

The bash that comes with git-for-windows

$ ssh-copy-id server
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
/usr/bin/ssh-copy-id: line 251: warning: here-document at line 251 delimited by end-of-file (wanted `EOF')
/usr/bin/ssh-copy-id: line 250: warning: here-document at line 250 delimited by end-of-file (wanted `EOF')
/usr/bin/ssh-copy-id: line 254: /dev/null`: Permission denied
/usr/bin/ssh-copy-id: line 260: EOF: command not found
user@server's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'server'"
and check to make sure that only the key(s) you wanted were added.

$ ssh server
user@server's password:        # should not ask here
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-122-generic x86_64)

Last login: Tue Oct 27 10:31:41 2020 from x.x.x.x
user@server:~$ ls -la | grep ssh
# No `~./ssh` folder created :-(
  • What did you expect to occur after running these commands?

That ssh-copy-id actually really copies the key (as stated in the output) and ssh user@server does not let me enter the password afterwards.

  • What actually happened instead?

Key not copied and password is still required.

@mhoyer
Copy link
Author

mhoyer commented Oct 27, 2020

I found the issue related to my problem: openssh/openssh-portable#206

✔️ I locally fixed my C:\Program Files\Git\usr\bin\ssh-copy-id according to the patch above and it's working again.

@dscho
Copy link
Member

dscho commented Oct 27, 2020

I found the issue related to my problem: openssh/openssh-portable#206

✔️ I locally fixed my C:\Program Files\Git\usr\bin\ssh-copy-id according to the patch above and it's working again.

Excellent find! Would you mind porting this to our MSYS2-packages and opening a PR at https://github.com/git-for-windows/MSYS2-packages?

mhoyer added a commit to mhoyer/MSYS2-packages that referenced this issue Oct 27, 2020
mhoyer added a commit to mhoyer/MSYS2-packages that referenced this issue Oct 27, 2020
Signed-off-by: Marcel Hoyer <mhoyer@pixelplastic.de>
@mhoyer
Copy link
Author

mhoyer commented Oct 27, 2020

@dscho, please check my attempt. Sadly there was no contribution guideline (how to create those patches etc) in the https://github.com/git-for-windows/MSYS2-packages repo. I hope, I did everything right?

dscho added a commit to git-for-windows/MSYS2-packages that referenced this issue Oct 27, 2020
@dscho dscho added this to the Next release milestone Oct 27, 2020
dscho added a commit to git-for-windows/build-extra that referenced this issue Oct 27, 2020
The recent regression where OpenSSH's `copy-ssh-id` [failed to work
correctly](git-for-windows/git#2873), was
[fixed](git-for-windows/MSYS2-packages#40).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants