Setting up SSH key authentication on Linux/Cygwin

On one of your machines:
$ ssh-keygen -t dsa (Don’t enter a passphrase unless you want to type it every time you want to use the key)
$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/id_dsa
$ chmod 644 ~/.ssh/id_dsa.pub

On SSH server(s)
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys2 (Or whatever public key you will accept)
$ chmod 600 ~/.ssh/authorized_keys2

To copy keys from one machine to another:
$ mkdir ~/.ssh (may not be necessary if it already exists)
$ chmod 700 ~/.ssh
$ scp <machine name>:.ssh/id_dsa* ~/.ssh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s