How to make ssh keys

16 Jun

SSH keys allow password-less logins

To make ssh key pair (for ssh2)

Host 1:
ssh-keygen -t dsa (or -t rsa)
scp .ssh/ host2:

On host two, you have to create .ssh/authorized_keys2 and chmod 600 it.
Then add the key to it:
cat >> .ssh/authorized_keys2

or do:
cat ~/.ssh/ | ssh you@other-host ‘cat –
>> ~/.ssh/authorized_keys’
you@other-host’s password:

You should then be able to ssh from host1 to host2 or vice-versa (check both, its not what you think! – i kept thinking it wasn’t wrong, but it was just that i had been trying to ssh the wrong way!)

use ssh -2 -v host2

– Make sure ~/.ssh is chmod 700
– Make sure ~/.ssh/authorized_keys2 is chmod 600


Leave a Reply

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

You are commenting using your 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

%d bloggers like this: