1. Login to Server A and Generate key ( You can generate RSA or DSA key ). I am demonstration RSA key with 2048 bit
hostAuser@hostA:~$ ssh-keygen -t rsa -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/hostAuser/.ssh/id_rsa):[enter]
Enter passphrase (empty for no passphrase): [enter]
Enter same passphrase again: [enter]
Your identification has been saved in /export/home/hostAuser/.ssh/id_rsa.
Your public key has been saved in /export/home/hostAuser/.ssh/id_rsa.pub.
2. After key generated there are 2 files created under /export/home/hostAuser/.ssh
3. Copy the id_rsa.pub key to Server B under /export/home/hostBuser/.ssh/authorized_keys
hostA# cat ~/.ssh/id_rsa.pub | ssh hostBuser@hostB “mkdir -p /export/home/hostAuser/.ssh && cat >> /export/home/hostAuser/.ssh/authorized_keys”
4. Change the permissions
chmod 700 /export/home/hostBuser/.ssh
chmod 644 /export/home/hostBuser/.ssh/authorized_keys
5. Validate the keyless entry by ssh from hostA to hostB
hostA $ ssh hostB
1. Telnet to destination server with port 22
> telnet hostb 22
If telnet port 22 is not working then Open firewall port 22
3. Verify the permission on directory and authorized keys