Home Windows ssh-copy-id
Post
Cancel

Windows ssh-copy-id

Windows OpenSSH equivalent of ssh-copy-id

ssh-copy-id is a awesome command to copy a ssh-key to a remote server.
It copies the public key of your ssh key to the remote server, making you able to login without using a password.

On linux normally you would use the ssh-copy-id command, but this command doesn’t work for Windows. Therefore you should use the following command for windows.

ONLY copies the public key to the remote host

1
2
# Copy id_rsa.pub to the remote aiuthorized server
get-content $env:USERPROFILE\.ssh\id_rsa.pub | ssh USER@IP-ADDRESS "cat >> .ssh/authorized_keys"

And to copy from linux to linux machine use this command:

It only copies the public key to the remote host

1
ssh-copy-id -i ~/.ssh/id_rsa USER@IP-ADDRESS
This post is licensed under CC BY 4.0 by the author.