How to login without password using putty- Private key / Public authentication – ssh

July 13th, 2009 by Giridhar | Posted under Linux.

How to login without password using putty- Private key / Public authentication – ssh

linux-penguinThis is how I setup a password less authentication using putty to one of the unix/linux box.
I am assuming that you are trying to login from a windows box using the ssh tool ‘putty’ to a Unix/Linux box.

Prerequisites

Putty
Puttygen

On your windows system

1.  Open putty-gen create a public key and private key, it is very much self explanatory how to
create a public key and private key once you open the tool putty-gen.
2.  Go to unix system and complete step 1 to 7
3.  Login to unix using putty as follows
putty  -i [privatekey.ppk] username@hostname

private  public key using putty gen

On Unix/Linux system
1.  Login to your unix box
2.  Go to your home dir
3.  Create or locate .ssh folder
4.  Change to .ssh folder (cd ~/.ssh)

5.  Create or append the public key created on windows using puttygen to
the file   called   ‘authorized_keys’
6.  Change the permissions to the file to 700 (chom 700 authorized_keys )
7.  Change the permission of .ssh directory also to 700

workarounds
Authorized_keys needs to be named authorized_keys2 for older versions of sshd

Tags: , , , ,

Comments

2 Responses to “How to login without password using putty- Private key / Public authentication – ssh”
  1. Good tutorial.. I liked it! Are you an Ethical Hacker?

  2. Girish says:

    no , I am not :)

Have any comments?