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, = public) will be created here: ~/.ssh/

sftp the 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 <


2 Replies to “Using public keys with ssh”

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.