Search This Blog

Thursday, November 18, 2010

SSH to server without any password...

You want the access of SSH server and don't wish to enter password all the times while connecting to the server. This can be the case someone using scp very frequently to copy multiple files from server to client or vice versa.

Scenario: User a on host A(client) want to access host B(server) having SSH server(OpenSSH) running on it, with access-without-password feature. :-)

Steps:

a@ubuntu_A:~$ ssh-keygen -t rsa
a@ubuntu_A:~$ ssh b@ubuntu_B mkdir -p .ssh
a@ubuntu_A:~$ cat .ssh/id_rsa.pub | ssh b@ubuntu_B 'cat >> .ssh/authorized_keys2'
b@ubuntu_B's password:
a@ubuntu_A:~$
a@ubuntu_A:~$ ssh b@ubuntu_B

Last login: Thu Nov 18 09:48:06 2010 from 192.168.1.102
b@ubuntu_B:~$

OR

Just came across this alternative...check this out:
a@ubuntu_A:~$ ssh-copy-id b@ubuntu_B
b@ubuntu_B's password:
a@ubuntu_A:~$ ssh b@ubuntu_B

Last login: Thu Nov 18 09:48:06 2010 from 192.168.1.102
b@ubuntu_B:~$

References:
http://linuxproblem.org/art_9.html
http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html

..............Done!!!

No comments:

Post a Comment