Wednesday, December 3, 2014

Create Trusted Connection Between two servers on Linux

Connection From server1 to server2

1. Create dsa key on server1 and take default settings, do not enter a passphrase.
[root@server1 /]# ssh-keygen -t dsa
2. Copy key from server1 to server2. 
[root@server1 /]# scp /root/.ssh/id_dsa.pub root@server2:/root/id_dsa.pub 
3. ssh to server 2:
[root@server1 /]# ssh root@server2 
4. Change to the /root/.ssh or if it does not exist create .ssh directory 
[root@server2 /]# mkdir /root/.ssh -p
5. create authorzed_keys file 
[root@server2 /]# cat /root/id_dsa.pub >>/root/.ssh/authorized_keys   
6. Change the permissions so that the owner has read,write and the        group and other has only read
[root@server2 /]# chmod 644  /root/.ssh/authorized_keys

Now you can ssh from server1 to server2 with out password or passphrase.

No comments:

Post a Comment