Pages

Tuesday, August 7, 2012

SSH Public key transfer


This public key gives us the passwordless log-in among machines

Machine1: BoxA  (A RHEL machine)
Machine2: BoxB (A RHEL machine)

Requirement: Need to establish a password less login from Machine2 -> machine1

Solution:
Login to BoxA
1) Created RSA keys by running command "ssh-keygen -t rsa" on Machine1
2) Added content of "id_rsa.pub" file from machine1 to the file "authorized_keys" in machine2
Login from machine1 -> machine2 is success

Login to BoxB
1) Added 
content of "id_rsa.pub" file from machine2 to a file "authorized_keys" in machine1
Login from machine2 -> machine1 still asking for password.

Problem: Permissions of ~/.ssh directory in machine1 is 755. ssh won't work if permission of ~/.ssh is other than 700.
Solution: Changed permission of 
~/.ssh to 700, now it is successful

No comments:

Post a Comment