SSH Authentication with Public-Key

Posted on Fri 18 February 2011 by Pavlo Khmel

Crete Private and Public key on serverA.khmel.org user "phn":

ssh-keygen -t rsa

without phrase.
Simple copy to serverB.phn.org.ua with command:

ssh-copy-id -i ~/.ssh/id_rsa.pub phn@serverB.khmel.org

Another way to copy key manualy on serverB.phn.org.ua in home directory of user "phn":

mkdir .ssh
chmod 700 .ssh
vi .ssh/authorized_keys
chmod 600 .ssh/authorized_keys

Verification from serverA.khmel.org:

ssh phn@serverB.khmel.org

or

ssh -o stricthostkeychecking=no phn@serverB.khmel.org

should work without password.