Accessing SSH Server Without Password

LINUX [Client Support]

Accessing SSH Server / Client Without Password.

Generating SSH Key to your log-in.

First log in as a user1 and generate a pair of authentication Keys. While you go through this process you will be asked to enter the passphrase. Do not enter any passphrase. Follow the steps shown as in bellow images.

     [cad@ganga ~]$
[cad@ganga ~]$ cd .ssh/
[cad@ganga .ssh]$ ll
total 32
-rw------- 1 cad cad 406 Dec 24 10:59 authorized_keys
-rw------- 1 cad cad 1675 Dec 24 10:54 id_rsa
-rw-r--r-- 1 cad cad 406 Dec 24 10:54 id_rsa.pub
-rw-r--r-- 1 cad cad 790 Dec 24 10:55 known_hosts

Above you can see some files list already. Its not necessary to have above files, You can clear all the file you have in .ssh folder in your home folder.

 
    [cad@ganga .ssh]$ now run "ssh-keygen" command and follow the steps. 
Here do not enter a passphrase just use the enter key.
Leave it empty.
[cad@ganga .ssh]$ ssh-
ssh-add ssh-agent ssh-copy-id ssh-keygen ssh-keyscan
[cad@ganga .ssh]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cad/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/cad/.ssh/id_rsa.
Your public key has been saved in /home/cad/.ssh/id_rsa.pub.

The key fingerprint is:
f9:c7:49:25:2a:c2:24:23:f8:84:89:1a:5c:45:cf:90 cad@ganga.nfsserver.com
[cad@ganga .ssh]$ Once the process over it genrate two files as shown above
with bold.

Copying id_rsa.pub to authorized_keys file

Now list for generated file and copy id_rsa.pub file to authorized_keys.

  
        [cad@ganga .ssh]$ ll  
total 16
-rw------- 1 cad cad 1675 Dec 24 11:16 id_rsa
-rw-r--r-- 1 cad cad 405 Dec 24 11:16 id_rsa.pub
[cad@ganga .ssh]$
[cad@ganga .ssh]$ now copy id_
[cad@ganga .ssh]$ l
[cad@ganga .ssh]$ ll
total 16
-rw------- 1 cad cad 1675 Dec 24 11:16 id_rsa
-rw-r--r-- 1 cad cad 405 Dec 24 11:16 id_rsa.pub
[cad@ganga .ssh]$ now copy id_rsa.pub to authorized_keys file
-bash: now: command not found
[cad@ganga .ssh]$ cp -rvf id_rsa.pub authorized_keys
`id_rsa.pub' -> `authorized_keys'

Log in to different Workstation / Pc in the Same network without Password.

Once the authorized_key file is generated, you can log in to different linux in the same network with passowrd. In case you are using SVN over SSH than you need not to enter the password. It will continue to process.

    [cad@ganga .ssh]$ ll 
total 24
-rw-r--r-- 1 cad cad 405 Dec 24 11:18 authorized_keys
-rw------- 1 cad cad 1675 Dec 24 11:16 id_rsa
-rw-r--r-- 1 cad cad 405 Dec 24 11:16 id_rsa.pub
[cad@ganga .ssh]$ you can see the authorized_keys file is copied.
Now you can try log in to different pc and it
will not ask for password
[cad@ganga .ssh]$ ssh -X cad@192.168.11.13
The authenticity of host '192.168.11.13 (192.168.11.13)' can't be established.
RSA key fingerprint is 40:6a:7a:92:e8:45:a1:6a:0e:23:ad:95:22:80:00:7c.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.11.13' (RSA) to the list of known hosts.
Last login: Wed Apr 4 12:48:41 2012 from ganga.nfserver.com