Tuesday, September 9, 2008, 04:31 PM - Technology
Posted by Administrator
Implementing password less login in LinuxPosted by Administrator
1.Create a user by giving command usradd and set password by giving command passwd
2.Login with that username
3.Give command ssh-keygen - t rsa
Press Enter for below options
Enter file in which to save the key
Enter passphrase (empty for no passphrase)
Enter same passphrase again:
Then it will show the message
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
a2:00:c1:84:d3:7a:4b:bc:52:f2:a1:e1:5d:c5:cc:40 user@machine
This will generate the rsa key for that particular user and will create 2 files in .ssh folder in that users home directory.The path will be /home/user/.ssh
the 2 files will be id_rsa and id_rsa.pub
4.We have to copy the id_rsa.pub file in the remote machine for which we need passwordless login.The same user must exist on the remote machine
and the contents of the same has to be copied in authorized_keys file
by giving
cat id_rsa.pub >> authorized_keys
command
5.Then on the remote machine we have to change the below options in sshd_config file present in the /etc/ssh directory.
RSAAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
#PasswordAuthentication yes
#PermitEmptyPasswords no
ChallengeResponseAuthentication yes
UsePAM no
These options are necessary for password less login to work.
6.Now restart the sshd service by giving the service sshd restart command.This will not terminate your existing session.
7.Try logging the user and it should go without the password.If still it is asking the password then check the file permissions for authorized_keys file
present on the remote machine.It should be 644(-rw-r--r--).
This should solve your problem of password less login.
Other categories
Cisco Jokes Photos Tutorials Voip Goa


Calendar




