Tuesday, November 26, 2013

Key Based SSH Authentication on a Linux Host using Putty

In order to be more secure, I have decided to use a key instead of a password authentication. I'm using putty to connect to my linux server. I have used the following steps in order to configure it:
  • Generate a public and private key with PuTTYgen (click on Generate):
The key is generated by mouving randomly the mouse.
  • Save the public and private key.
  • The next step is to add the public key on the server:
mkdir ~/.ssh
chmod 700 ~/.ssh
  • Paste the public key to the following file:
vim ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
  • Configure the putty session:
    • Create a new session and save it:

    • Select data and configure 'Auto-login' (usersame used by the created key):

    • Configure the path to the private key:


After this, if you open the session, you will be directly prompted to the linux host.



No comments:

Post a Comment