HostOnNet Blog

Copying SSH key to Remote Server

Looking for Linux Server Admin or WordPress Expert? We can help.

ssh-copy-id command is used to copy your SSH public key to remote server for password less authentication.

Once you have your SSH key generated with ssh-keygen command, you need to run

ssh-copy-id user@host

You will be asked to enter password. One you enter password, ssh-copy-id will transfer your public key to remote server and install it.

Next time, when you login to remote server with

ssh user@host

You won’t need to enter password as your ssh key is added to ~/.ssh/authorized_keys file.

You can do this manually by copying content of file ~/.ssh/id_rsa.pub (this is your SSH public key, it is safe to share it with others).

cat ~/.ssh/id_rsa.pub

To remote servers ~/.ssh/authorized_keys

See ssh

Posted in Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.