Powershell script duplicating ssh-copy-id behaviour in Windows.
It depends on plink.exe. Download and place it on the same folder as the script.
- Default (public key file named
id_rsa.pub
):.\ssh-copy-id.ps1 user@example.com password
- Specify public key file:
.\ssh-copy-id.ps1 -i idtest.pub user@example.com password
- Port other than 22:
.\ssh-copy-id.ps1 -P 1234 user@example.com password
Pull requests are welcome for the following functionalities:
- Default mode: prompt for key, host/port and password
- Check .authorized_keys to see if the key already exists
Original work from VijayS1.