Generate your SSH key:

$ ssh-keygen -t rsa

Copy over to destination host:

$ scp ~/.ssh/ user@host:~/.ssh

Login to remote host (still using password):

$ ssh user@host
user@host's password:
$ cd ~/.ssh
$ cat ./ >> ./authorized_keys
$ rm -f ./
$ chown 600 ./authorized_keys

Logout and try login again:

$ ssh user@host
Enter passphrase for key '/home/localusr/.ssh/id_rsa':

That’s it. Enter the passphrase and you can login using your key.


SSH Login Using Keys

Leave a Reply

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