Oct 22, 2018

How to automate SSH Login with PuTTY

generate the key pairs with PuTTYgen (puttygen.exe)
Save Private Key and save it somewhere on your computer.
On the server, create the file ~/.ssh/authorized_keys containing the generated public
key on a single line.
Make this file readable (chmod 600).
open up PuTTY and navigate to Connection->Data and fill in the
auto-login username.
Connection->SSH->Auth and under Private-key, browse to the file you had
saved earlier on your computer.

If message “Server refused our key” is generated, remember that permissions for .ssh or authorized_keys should exactly follow grants issued with “chmod 700″ for .ssh and “chmod 600″ for authorized_keys. (chmod 700 .ssh is not necessary but it is recommended.)