Set up ssh keys for password free login
Dec 14, 2007 by Will Mernagh
Step 1
On each machine type ssh somemachine.example.com and make a connection with your regular password. This will create a .ssh dir in your home directory with the proper perms.
Step 2
On your primary machine (the machine that you will ssh from) where you want your secret keys to live (let’s say kermit), type
ssh-keygen -t dsa
This will prompt you for a secret passphrase. If this is your primary identity key, make sure to use a good passphrase. If this works right you will get two files called id_dsa and id_dsa.pub in your .ssh dir. Note: it is possible to just press the enter key when prompted for a passphrase, which will make a key with no passphrase. This is a Bad Idea for an identity key, so don’t do it!
Step 3
Copy the id_dsa.pub file to the other host’s .ssh dir with the name authorized_keys2.
scp ~/.ssh/id_dsa.pub misspiggy:.ssh/authorized_keys2
Now misspiggy is ready to accept your ssh key.
Step 4
How to tell it which keys to use? Simply ssh misspigy from kermit and type your pass phrase when prompted. This will then be saved so every other time you ssh it will not be required.
