Torrid  
Home Sitemap Contac us
     
Home   Knowledge Center   SSH without password
Network Monitoring Using Nagios
................................................
IT Service Desk
................................................
SSH without password
................................................
 
 
 
SSH without Password 


Instead of entering passwords at SSH login prompt, administrators can login to remote Linux servers using public/private key pair. It can help administrators in following ways:

1. Running commands on multiple server from a single console
2. Automated server backups using scripts
3. No need to remember passwords for multiple servers

Due to limitations in SSH protocol version 1, we recommend to use version 2 of SSH protocol.

Scenario
In this document, we will explain you on how to login from a client machine 'C' to a server 'S' without using password.

Configuration
Login to the client linux machine 'C' via ssh to run below command and press "ENTER" three times:

Generate Key Pair

Above command was executed as "root" user, and same can be done as a system user as well. Command will save a public/private key pair in .ssh directory located in HOME directory of the user. As in above case, command was executed as "root" so it will save the key pair in "/root/.ssh/".

After this, you need to append pubilc key of client machine 'C' stored in id_dsa.pub to /root/.ssh/authorized_keys file of linux server 'S'. To achieve that, run following command from linux client 'C'. And on the password prompt, enter the user (in this case "root") password for linux server 'S':

Copy Public Key to Server

Now login to the server machine 'S' and execute below command to append the pubilc file of client machine 'C' to authorized_keys file

Append Public Key to authorized_keys in server.

Every thing has been setup now. For testing, run below command from client machine 'C' to verify that you are able to login to remote linux server 'S' without entering password.

Login to Server

Now, you can also copy files from serve to client and vice-versa using "scp" without being prompted for password.

WARNING:
Keep you private key (id_dsa) stored in client machine 'C' as secret. Anyone having access to the private key can use that for remote login to the server without any further authentication.

Feedback/Suggestions: feedback@torridnet.com