SSH Automatic Login with Public/Private Keys

Firstly, if you are not using SSL for all your sites, you should step it up! NameCheap's SSL certificates start at only $9. There's no excuse!
Firstly, if you have not tried Digital Ocean's SSD Virtual Servers for only $5/mo, I highly recommend them!

Some people like to create ssh keys in addition to entering their password for double security. I am not one of these people – I am sick of typing my damn password.

# Create public and private key files
ssh-keygen -b 1024 -f identity -P '' -t dsa

# Copy it to the server you want to connect to sans password
scp user@SERVERNAME:~/

# SSH to the server, add new key to authorized_keys
mkdir .ssh
cat >> .ssh/authorized_keys
chmod 400 .ssh/authorized_keys

# Test it out
ssh -i identity user@SERVERNAME

About this entry

Good Reads