Steps for setting up public/private key authentication over SSH.

Download and run PuttyGen from

Hmmmmm. Security

Hmmmmm. Security

  • ¬†Click on the Generate button to generate the key set

On the server run the following commands

##From Home Directory
##Create .ssh directory
mkdir .ssh

##Set the permissions on the directory
chmod 700 .ssh

##Enter into the directory
cd .ssh

##Create the authorized_keys file
vi authorized_keys

Copy and paste the selected text from the image above into the authorized keys file exactly as it is extracted. (i.e. remove and trailing line returns etc)

Then click on the Save Private Key button to save the private key to a secure location

Next we need to enable this access in the SSH Config

##Edit the SSH Config
sudo vi /etc/ssh/sshd_config

##Uncomment the following
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      %h/.ssh/authorized_keys

Restart SSH

sudo service ssh restart

And finally setup putty to use the Private Key.

  • Host Name: user@server (i.e. [email protected])
  • Under Connection Select SSH –> Auth
  • Save the connection and all done.