Public Key for SSH Authentication

Password-less SSH can really help server administrator on accessing from different node to another. This is possible by setting up the public key for SSH authentication in source and destination server.

1. Create your public and private key pair by typing:

ssh-keygen -t dsa

2. The key generator will ask you where you want to save your key. Press Enter to accept the default.

3. Next, the generator will prompt you to enter a passphrase. Press Enter without entering a passphrase. (You must leave this blank to make sure that destination server will not prompt out anything when authenticating SSH user)

You will need to copy your public key to your destination server. Do this by entering the following command (you will need to enter your password just this one time after you press Enter):

ssh-copy-id -i ~/.ssh/id_dsa [email protected]

*user = the username of your destination server
*serverIP = the IP address of your destination server

Test your setup by entering: ssh user@serverIP. If you’ve set this up correctly, you shouldn’t have to enter any login details, and now you are ready to connect to the destination server without hassle of remembering the password.