*******************************************************************************************Step by Step Implementation of key based authentications from Source A to Destination B. *******************************************************************************************
(1) At source A
(1-A) Generate a Key
ssh-keygen -t dsa
Sampe Output
posdbprod21->CIF@(/export/home/oracle/paresh)ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
dd:0c:2d:29:87:d9:a1:fd:5c:fc:c1:e8:76:a2:93:25 oracle@posdbprod21
posdbprod21->CIF@(/export/home/oracle/paresh)
Above command creates a public key file called : id_dsa.pub and private key called id_dsa
(1-B) Cat id_dsa.pub to the destination B and save as a file called authorized_keys for ssh1 or authorized_keys for ssh2 in the .ssh directory of that login-id.
(2) At the source then create a file called config with the following contents
Host TARGET_IP_ADDRESS
User oracle
Compression yes
Protocol 2
RSAAuthentication yes
StrictHostKeyChecking no
ForwardAgent yes
ForwardX11 yes
IdentityFile /export/home/oracle/.ssh/id_dsa