The Windows version of OpenSSH client doesn't include a ssh-copy-id command. I don't know why. If it does one day, then this gist can be ignored.
- This script is written in PowerShell as the legacy program
cmd.exe
is not flexible enough for the required options. - Download the file
ssh-copy-id.ps1
to your Windows PC, or copy and paste its contents to a file of the same name. - Run the script passing your linux account ssh information (for example
powershell .\ssh-copy-id.ps1 [email protected]
). If you use a non-standard port add the parameter-port=nnnn
. This should work with any Linux platform. - Run the command for each linux account you connect with. You will be prompted for your Linux host password. If you have more than 1 account on any machine, you must do this for each account.
If the script won't run, then run this command once
Set-ExecutionPolicy RemoteSigned CurrentUser