Okay. I generated the rsa key pair on nas2, which is the server that I want to connect to my other three servers to grab the data for backup.
I used this command:
Code:
ssh-keygen -t rsa -f /root/.ssh/4rsync/rsa_key4backup
Then I used this command to copy the .pub key to the target machine:
Code:
scp ~/.ssh/rsa_key4backup.pub dns1:/root/.ssh/rsa_key4backup.pub
and I entered the password for the target server.
Next I ssh into target (dns1) to register the key:
Code:
ssh dns1
entered the password
cat rsa_key4backup.pub >> authorized_keys
Here is the ls -l ~/.ssh/ output for target (dns1):
Code:
root@dns1:~# ls -l ~/.ssh/
total 64
-rw------- 1 root root 2637 2012-11-19 16:28 authorized_keys
-rw------- 1 root root 391 2012-11-19 16:04 authorized_keys2
-rw-r--r-- 1 root root 395 2011-11-07 14:52 commserv.jab
-rw------- 1 root root 668 2005-12-07 09:59 id_dsa
-rw-r--r-- 1 root root 610 2005-12-07 10:00 id_dsa.pub
-rw------- 1 root root 883 2005-12-07 09:59 id_rsa
-rw------- 1 root root 1675 2012-09-20 17:19 id_rsa-new
-rw-r--r-- 1 root root 391 2012-09-20 17:19 id_rsa-new.pub
-rw-r--r-- 1 root root 230 2005-12-07 10:00 id_rsa.pub
-rw-r--r-- 1 root root 2456 2008-07-30 12:23 jab
-rw-r--r-- 1 root root 6501 2012-09-21 16:41 known_hosts
-rw-r--r-- 1 root root 223 2005-08-27 20:49 rsa_key.pub
-rw-r--r-- 1 root root 391 2012-11-19 16:02 rsa_key4backup.pub <<<<<<<<This is my .pub key from nas2]]]]]]]
-rw-r--r-- 1 root root 395 2008-07-30 12:54 serv_ssh_host_rsa_key.pub
-rw-r----- 1 root root 210 2011-11-07 15:50 uniserv.jab
Here is the ls -l ~/.ssh/ for nas2:
Code:
root@nas2:~#ls -l ~/.ssh/
drwxr-xr-x 2 root root 1024 Nov 19 15:33 4rsync/ <<<<<the rsa key pairs are in this dir]]]
-rw-r--r-- 1 root root 601 Oct 8 09:09 authorized_keys
-rw-r--r-- 1 root root 1116 Jul 12 10:44 authorized_keys2
-rw------- 1 root root 668 Oct 8 09:09 id_dsa
-rw-r--r-- 1 root root 1699 Nov 19 15:52 known_hosts