SSH without password HOWTO for CentOS 5.2
This one is short and sweet and is for CentOS 5.2 installs.
On the client machine generate a public key. Do this command as the user you normally run under:
ssh-keygen -t rsa (take the defaults)
There is now a new file called id_rsa.pub in ~/.ssh/
Copy the id_rsa.pub file to the server:
scp ~/.ssh/id_rsa.pub someUser@someServer.com:/home/someUser/
Log into the server:
ssh someUser@someServer.com
Append your client public key to authorized_keys:
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
Remove the client public key on the server, you don't need it anymore:
rm ~/id_rsa.pub
Set permissions on the server so sshd can see authorized_keys:
chmod 755 /home/someUser
chmod 700 /home/someUser/.ssh
chmod 644 /home/someUser/.ssh/authorized_keys
That's it, the next time you login to the server via the client it shouldn't ask for a password.






Comments
scp? [Reply]
Why don't use ssh-copy-id ?