1. Download Puttygen from the PuTTY Homepage

2. Launch Puttygen

3. Click the 'Generate' button, and move your mouse around to generate random data as it describes. Don't let anyone watch you, or they might be able to duplicate your mouse movements exactly and compromise the security.

4. Click 'Save Private Key'. Ignore the warning (see below), and put the file somewhere you can find it - we'll use it in a few steps.

About the complaint if you haven't specified a passphrase: If you specify a passphrase, you will have to enter the passphrase every time you use this key. Not much of an improvement over entering in a password anyway, no? The thing is though, if you care about security for systems using this key, and you lose the key, you have left yourself wide open. HOWEVER this is perfectly ok if you're careful about your key (e.g., don't put it on a shared drive!) and/or if you use it for internal-only test machines.

5. Launch Putty and connect to your server. Go into the home directory for the user you want to be able to autologin. For root (which is what one commonly uses for a test machine), go to /root. For user bozo, go to /home/bozo

6. Within this directory, go into the .ssh directory

7. Now edit (or create, if it doesn't exist) the authorized_keys file. Copy the entire mess of text from Puttygen where it indicates Public key for pasting into authorized_keys file, then paste it into authorized_keys. This big mess should be on a new line if there was already a key there. Do not insert carriage returns. NOTE: I have had issues where pasting via putty resulted in wrapped lines (and it wouldn't work). The entry should be one LONG line.

8. Within the putty tool, load your session (choose the session name you saved, and click load). Now choose Connection from the tree on the left. Put the user name you want to autologin in the Auto-login username textbox.

9. Now choose Auth from the tree on the left (it is under Connection->SSH->Auth) and click the 'Browse' button. Locate the private key you created in step 4..

10. Go back to the Session screen, click your session name and click save. You're done! If all is well, it should simply login automatically like this:

Sent username "fruity" Trying public key authentication. No passphrase required. Last login: Wed Jun 18 11:51:19 2003 from 192.168.1.10

11. Note, you can install the public key (steps 5-7) on any number of servers. That way, if you have a ton of test machines you can configure them all to autologin with the same key.

-- MattWalsh - 18 Jun 2003

Topic revision: r3 - 19 Mar 2004 - MattWalsh
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback