Secure SSH to server

Manager's picture

To do this you need to create a RSA Key for SSH Authentication

Using your terminal

ssh-keygen -t rsa

it will return a line like this

Enter file in which to save the key (/home/~USER~/.ssh/id_rsa):

copy /home/~USER~/.ssh/id_rsa

So it looks like

Enter file in which to save the key (/home/~USER~/.ssh/id_rsa):/home/~USER~/.ssh/id_rsa

And press return

You can leave the pass phrase blank or create one

Then copy the file to the home directory of your server

scp .ssh/id_rsa.pub username@IP.ADD.RE.SS:~

log into your server

ssh -2 IP.AD.DR.ESS -p 22 -l USER-NAME

cd $HOME
you should see your file id_rsa
# cat id_rsa.pub >> .ssh/authorized_keys

To add the contents of id_rsa.pub

Disable passwords on the server and you should be able to ssh into the server without a password