SSH Login Without Password
Following are the steps we should configure in order to do ssh without password.
1. Suppose we have two user’s user ‘A’ and user ‘B’
First login to user A as user A and generate a pair of authentication keys.
(userA)# ssh -keygen -t rsa
Generating public/private rsa key pair
Enter the file where you want to save the key (home/a/.ssh/id_rsa):
Created directory
Enter passphrase:
Enter same passphrase:
Your identification is save in file /home/a/.ssh/id_rsa.
Your public key is save in file /home/a/.ssh/id_rsa.pub.
The key fingerprint is
xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx.xx @userA
2. Now use ssh to create a directory ~/. ssh as userB on userB system
(userA) ssh userB mkdir -p .ssh
It will prompt for password .
Eneter the password for userB
3. Finally append the new key to userb:.ssh/authorized key and enter passowrd for userB
(userA): cat .ssh/id_rsa.pub | ssh userB ‘cat >> .ssh/authorized_key’s
userB passowrd:
So now you can log into userB from userA without password
# (userA): ssh userB
Login to useB.
You can see it does not ask for password.
#(userB):

Leave a Reply