Who am I?
nfocipher

Head Grunt, David “NfoCipher” Bunt - I'm a programmer..
Experience: With over 14 years professional experience both in corporate and small business environments. I'm a Linux junkie, have a healthy respect for macs, but cannot tolerate anything microsoft related. Been there, done that, never again.

search
calendar
« September 2010 »
Su Mo Tu We Th Fr Sa
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Recently...
Categories
Links
Archives
Syndicate
Credits
LifeType IE7 XHTML CSS Firefox

« | »

SSH without password HOWTO for CentOS 5.2

2009-03-15 @ 05:22 in Coding

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 ?

Posted by davi @ 10:07, 2009-06-21
Add comment
 authimage