here is the exact process, which never failed for me till date (atleast)!!
making an automated(without asking password) process for SSH between "bimalserver"(10.10.10.1) and "balwantserver"(10.10.10.5) do as
login on bimalserver as a general user "bimal" and execute ssh-keygen command as...
[bimal bimalserver bimal]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/bimal/.ssh/id_rsa):
Created directory '/home/bimal/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/bimal/.ssh/id_rsa.
Your public key has been saved in /home/bimal/.ssh/id_rsa.pub.
The key fingerprint is:
b8:30:b8:b3:53:4c:29:60:0e:fe:5f:c0:58:3c:6e:df bimal bimalserver
1) if you don't provide a file name it will create it at its own.
2) keep "passphrase" BLANK i.e. just hit enter when asked for,now you need to put "id_rsa.pub"
file(in fact, content) onto other machine in the home of a user as of whom you want to get in
e.g there is another machine "balwantserver" on which there is a user "balwant"
so what you need to do is, in the "/home/balwant/.ssh/" directory of user "balwant" of "balwantserver"
create a file "authorized_keys2" and put the content of "id_rsa.pub" of user "bimal" of "bimalserver"
in it i.e. from bimalserver do
[bimal bimalserver bimal]$ scp /home/bimal/.ssh/id_rsa.pub
balwant balwantserver:/home/balwant/.ssh/bimal_pub_key (you need to provide balwant's password as of now)
now do on balwantserver
[balwant balwantserver balwant]$ cd .ssh
[balwant balwantserver .ssh]$ cat bimal_pub_key >> authorized_keys2
now check whether this is working or not so, on server bimalserver
[bimal bimalserver bimal]$ ssh -l balwant balwantserver whoami
this should return balwant, if not that means your ssh automated part is having some error!! and
either of "US" has commited a mistake, please - recheck it and inform me too...