62 DB2 Deployment Guide
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'baltic,9.43.86.48' (RSA) to the list of known
hosts.
root@baltic's password:
For RSA encryption, the command is almost the same as DSA, except for the
name of the public key file.
cat ~/.ssh/id_rsa.pub | ssh root@baltic 'cat >> ~/.ssh/authorized_keys'
4. Now we have successfully enabled automatic login on the remote machine
Baltic. As a root user, we can issue the following command from Zaire (file
server) to login to Baltic without specifying the password:
ssh Baltic
On Baltic, we can have a look at the authorized_keys file, which is used to
keep the public key for root user of Zaire. See Example 2-16.
Example 2-16 Public key is kept in authorized_keys on Baltic
# cd ~/.ssh
# ls -alt
total 16
drwx------ 2 root system 256 Jun 18 16:53 .
-rw-r--r-- 1 root system 600 Jun 18 16:53 authorized_keys
drwxr-xr-x 33 root system 4096 Jun 09 15:24 ..
# cat authorized_keys
ssh-dss AAAAB3NzaC1kc3MAAACBAPk6QOR2/cQ+t3H3SIhQXxawPa5T0/
o4KnHy02AZ0p1woawkvMPSjPwkuMw+70zFKVNZFKnCzaheSCjjbzSQRG4ZJlgNjcZetDr/
1+zKKpfj4696qbZ7wxffZz9aIkibIi
......
M+6TNy16P0v3l4aOENOLxIZAL9Lbg0fkEW7Ay4XW9V7a5IvbvbuxM= root@Zaire
5. There is another remote machine, Banda, where the DB2 server must be
deployed. Therefore, we have to copy the public key to Banda just like we did
in step 3.
cat ~/.ssh/id_dsa.pub | ssh root@banda 'cat >> ~/.ssh/authorized_keys'
Note: The automatic login that we have enabled on Baltic and Banda works in
only one direction. This means that the root user on Zaire can login to Baltic or
Banda without a password prompt, but the root user on Baltic or Banda still
has to specify a password on each login attempt to Zaire. This is because we
did not distribute Baltic’s or Banda’s public key file to Zaire. In our mass
deployment scenario, we do not require bidirectional automatic login.