Wednesday, September 5, 2012

Setup SSH Server Without ASking password in CENTOS 6.3

Setup SSH Server Without ASking password in CENTOS 6.3

in client (assume IP : 192.168.0.31)

Create RSA KEY
# ssh-keygen -t rsa

will create   ~/.ssh directory called id_rsa and id_rsa.pub. id_rsa is your private key and id_rsa.pub
- id_rsa
- id_rsa.pub
later copy id_rsa.pub to server

in server (assume IP : 192.168.0.30)

copy id_rsa.pub from your client and restore in /root/.ssh directory on your server and named it as authorized_keys
#scp -r 192.168.0.31:/root/.ssh/id_rsa.pub /root/.ssh/authorized_keys

edit and change sshd config in /etc/ssh/sshd_config in your server with :

PermitRootLogin  yes
RSAAuthentication  yes
PubkeyAuthentication  yes
AuthorizedKeysFile    .ssh/authorized_keys
PermitEmptyPasswords  yes
PasswordAuthentication  yes

restart your sshd server
#/etc/init.d/sshd restart

No comments: