PuTTy HOW-TOs
Q. Do I have to type in the hostname everytime I use putty?
No. PuTTy can remember information such as the hostname and the
protocol to use and save it in a session. So if you double-click the
name of your session, it will open the session for you.
Q. How do I create a session?
Open PuTTy. Select "Session" on the Category pane (left pane). Type in
the name of the machine you want to connect to, say,
admiral.cs.uchicago.edu. Then under Protocol, click
SSH.
Now your Port number should automatically read
22. Then select
"SSH" on the Category pane (under Connection). Now on the right pane,
under Preferred SSH Protocol Version select 2. Finally, select "Session"
again, and type in a short name under "Saved Sessions", say admiral, and
click on Save. Now you should see the session you have created in the
list of Saved Sessions. Any time you want to use these settings, just
double click on the name of the saved session and you are on your way.
Q. Do I have to type in my password every time I login using PuTTy?
No. A password, is one of the many ways you authenticate yourself to the
server. Another way is to use Public Key authentication. For more information
on how Public key authentication actually works see the
PuTTy
Documentation. If you just want to use it, see the next question.
Q. How do I generate the Keys for use in Public Key authentication?
For this you need the utility called PuTTYgen. You can download it from
the same place you got PuTTy. Run PuTTYgen and choose "SSH2 RSA" under
the Type of Key to generate and 1024 for the number of bits
in the generated key. Click on Generate and then move you mouse
around in the specified area to help generate some entropy. Once
your key has been generated, save your private key to a local file.
Note that, we will not be encrypting the private key. That would mean
you have to type in a long passphrase everytime you decrypt
it (might as well type in the shorter password). This also means, if any body
gets access to your private key, they can login as you. So store this in a safe
place (not on your desktop) in your hard disk. Then change the Key comment, if
you want, so that you can identify this key. Finally copy and paste the
"Public Key" into
.ssh/authorized_keys2 in your home directory. You may
need to create the
.ssh directory as well the
authorized_keys2 file. If the file already exists, just add this at the
end of your file.
Q. OK. I have created the keys, and stored my public key on the server. Now What?
Now, we need to teach PuTTy about your private key. Now run PuTTy, select your
session (dont double click it) and click Load. Then on the Category pane, select
"Auth" (under SSH under Connection). On the right pane, choose the file which
has your private key. Now select "Session" on the Category pane and hit Save,
to save this additional information. Now, if everything was done right, if you
double click on the session name and type in your username, you should get a
shell without having to type in your password.
Q. Do I have to double click the session name everytime I need to login?
No. You can create a shortcut on your desktop, which will tell PuTTy to
automatically start with a given session name. To do this, right click on an
empty area of your desktop and Select "New -> Shortcut". Browse to the location
of your putty executable and select it. Dont select Next. The location textbox
will have something like "C:\path\to\directory\putty.exe". Change it so that it
reads "C:\path\to\directory\putty.exe -load sessionname", where sessionname is
the name of session you want to automatically load. Now type in a name for this
shortcut, say ssh-sessionname and click finish. Now everytime you double click
this shortcut, and type in your username, you are logged in.
Q. Do I have to type in my username everytime?
No. Create a shortcut to "C:\path\to\directory\putty.exe -l username. So for
complete automation "C:\....\putty -load session -l username" should do the trick.
Q. I am paranoid about my private key. Can I encrypt it and not have to
type in the passphrase?
No. However, you can use the utility pageant.exe, and type in your passphrase
once every time you login to windows, instead of once every time you connect
to a remote machine.
Q. Is there a longer FAQ?
Yes. Visit the
PuTTy FAQ.