Aide Memoir: Setting up auto logins with SSH

This is something that I always forget how to do. Here is the recipe adapted from Linux Server Hacks.

<

ol>

  1. First generate your key
    $ ssh-keygen -t rsa

This created two files, ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub.
5. Then copy the key pair to the host you want to login to

$ ssh -l userserver “mkdir .ssh; chmod 0700 .ssh”*
$ scp .ssh/id_rsa.pub *user
@server:.ssh/authorized_keys2
6. Now you can login using
$ ssh -l eechrisserver**

and you don’t need a password. Exchange of public keys authenticates you.

Author: cpjobling

Senior lecturer, College of Engineering, Swansea University