It took me many attempts to work out password-less ssh, mainly because a lot of internet guides are not written that well and following them step by step didn't work.

Then I found one that did work! Woohoo!

So I've copied and pasted it here... and regrettably forgotten the link I found it from. If anyone recognizes this then I'll gladly reference it to the correct source.

The guide makes use of local$ and remote$, this is to indicate if you are typing on your local or remote server.

Create the private key

view plain print about
1local$ ssh-keygen -t rsa (accept default file locations and create a password for your private key)
2local$ scp ~/.ssh/id_rsa.pub user@remote:/home/user/
3local$ ssh user@remote (enter normal root password)
4remote$ cat ~/id_rsa.pub >
> ~/.ssh/authorized_keys
5remote$ chmod 600 ~/.ssh/authorized_keys
6remote$ exit
7local$ ssh user@remote (at this point you shold be asked to enter the password for your private key)

Add private key password

The password for the private key needs storing in your machine. This is encrypted.
view plain print about
1local$ ssh-agent bash
2local$ ssh-add ~/.ssh/id_rsa
3local$ ssh user@remote (you should no longer be asked for a password)

Note: in the code examples above, don't type the stuff in brackets

Note 2: I think this was the blog I got the entry from, but it doesn't work any more so I can't be sure... I definitely looked there before I found it anyway: http://blogs.translucentcode.org/mick/archives/000230.html