Wednesday, September 17, 2008

Using SSH without a password

Here's the quick and dirty way to login to ssh without a password (tested on Redhat Linux)

1. user@client$ ssh-keygen -t rsa
(hit enter for blank password and take all defaults)

2. user@server$ mkdir ~/home/user/.ssh

3. user@client$ cat ~/.ssh/id_rsa.pub | ssh user@server "cat >> .ssh/authorized_keys"

4. root@server$ vi /etc/ssh/sshd_config
change PermitEmptyPasswords to "yes"
root@server$ service sshd restart

If you run into problems, make sure the permissions for the .ssh directories and all files beneath it are set to 700 (ie: chmod -R 700 /home/user/.ssh)

There are obviously some security implications here. Use at your own risk!