= Copy ssh key to a remote server =

The ssh-copy-id command installs ssh key on a server as an authorized key. It allows for access provisioning without requiring a password for each subsequent login.

How to use it

Once the key has been generated, you can use the ssh-copy-id command to install it on a server. Use the following command to authorize the key named mykey:

ssh-copy-id ~/.ssh/mykey user@host

Only the public key is being copied. The private key should never be touched.

Once the key has been copied, it is the best to test it:

ssh -i ~/.ssh/mykey user@host

The login should now be completed without asking for a password.


You will need to install this tool separately using for example Homebrew.

brew install ssh-copy-id

Alternatively you can install the tool using the following command:

curl -L https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/install.sh | sh 

= References =