Using public keys with ssh

From the client:

mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa

By default the key files (id_rsa = private, id_rsa.pub = public) will be created here: ~/.ssh/

sftp the id_rsa.pub file to the remote machine, and drop it in ~/.ssh.

If you’re using OpenSSH on the remote machine, do this to append the file to the authorized_keys2 file (cd into your .ssh dir):

cat >> authorized_keys2 < id_rsa.pub

 

2 Replies to “Using public keys with ssh”

Leave a Reply

Your email address will not be published.

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