Git's ssh is a version of OpenSSH. You can confirm it by running ssh -V
under path\to\git\usr\bin
. Here is what it evals on my machine:
OpenSSH_7.7p1, OpenSSL 1.0.2o 27 Mar 2018
ssh-copy-id
script internally executes some *nix shell command (like exec
, cat
, etc. You can find more by opening the one under path\to\git\usr\bin
in text mode), so it works only against *nix machines. That's the reason why ssh-copy-id
under path\to\git\usr\bin
is not a executable file.
According to this issue of PowerShell/Win32-OpenSSH, ssh-copy-id
is not supported on Windows.
However, there are some alternative ways to do the same thing:
A powershell version of this answer can be
Get-Content $env:USERPROFILE\.ssh\id_rsa.pub | ssh <user>@<hostname> "cat >> .ssh/authorized_keys"
There is also a python script to do the same thing: ssh-copy-id for Windows.