Normally we can  connect remote server  using SSH (Secure SHELL) for managing or execute programs on Linux.  Also support to transferring files from a server to another server. This post will help you how to login into your server without entering password.  This SSH keys increase more secure connection between two  or multiple Linux servers.
 
Do you like to an automatic login from server 192.168.0.1 as user xxx to 192.168.0.2 as user yyy without enter any password.

Login into your server IP address : 192.168.0.1 with user xxx, then generate a pair of authentication keys using command ssh-keygen
 

$ ssh -p 22 xxx@192.168.0.1

$  ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

Generating public/private dsa key pair.
Created directory '/home/xxx/.ssh'.
Your identification has been saved in /home/xxx/.ssh/id_dsa.
Your public key has been saved in /home/xxx/.ssh/id_dsa.pub.
The key fingerprint is:
d7:c3:35:db:85:ab:87:7e:c2:44:a3:2d:49:7a:ea:4d xxx@192.168.0.1
The key's randomart image is:
+--[ DSA 1024]----+
|                 |
|               . |
|              + .|
|          .oo. =.|
|        So.=+.o .|
|        ..= o+   |
|         oE+o .  |
|        .o .o..  |
|       .. . .o   |
+-----------------+

 Now, just create a directory to yyy user on 192.168.0.2
 
$ ssh yyy@192.168.0.2 mkdir -p .ssh

Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.2' (RSA) to the list of known hosts.
yyy@192.168.0.2's password:


Finally append xxx generated  new public key to yyy on 192.168.0.2 .ssh/authorized_keys,
 
$  cat .ssh/id_rsa.pub | ssh yyy@192.168.0.2  'cat >> .ssh/authorized_keys'

Then, we set the permission on .ssh directory and authorized_keys,
 
$  ssh yyy@192.168.0.2  "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"

Finally, connect remote server via ssh without entering password.
 
$  ssh -i ~/.ssh/id_dsa 192.168.0.2

or
 
$ ssh -p 22 root@192.168.0.2