This is the method to connect ssh without password because sometimes it becomes irritating.
How to do it
Open your terminal and type
shobhit@mac :~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory ‘/home/a/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 shobhit@mac
Now login to ssh using your password.
shobhit@vpc mkdir -p .ssh
shobhit@vpc vim .ssh/authorized_keys
Now type :wq to create a Blank File
Now at your Terminal. This is the last time you will be using your password
shobhit@mac:~> cat .ssh/id_rsa.pub | ssh shobhit@vpc ‘cat >> .ssh/authorized_keys’
shobhit@mac’s password:
From now on you can log into B as b from A as a without password:
shobhit@mac:~> ssh shobhit@vpc hostname
A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:
Put the public key in .ssh/authorized_keys2
Change the permissions of .ssh to 700
Change the permissions of .ssh/authorized_keys2 to 640
Tags: no password ssh login, passwordless ssh login, SSH login without password, ssh password less, ssh without password