1. Create a key using putty gen.

  2. Paste the content into .ssh/authorized_keys file .

  3. You should be able to login without password.

In linux you can generate the key using :

ssh-keygen -t rsa

Then copy the content of id_rsa.pub to .ssh/authorized_keys

cat id_rsa.pub > authorized_keys

Make sure the permissions are :

chmod 755 .ssh chmod 600 ~/.ssh/authorized_keys

Make sure Selinux is disabled. If you want to leave selinux enabled, check the part at the bottom.

Tips & Tricks

You have to disable strict mode in ssh config file if the home directory has access to other users.

You can restrict the hostnames from where they can connect to  the server

from=".example.com,.test.com" ssh-rsa AAAxxxxxx.......

or

from="137.248.1.*" ssh-rsa AAAxxxxxx..

SELINUX in Centos 6 causes the keys to be ignored

restorecon -R -v /root/.ssh

This will fix the issue !