Home

Prerequsite

You need to have following basic knowledge to understand this HOW-TO article,

Basics

  1. Download following executable at [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html this link]
    • putty.exe
    • pscp.exe
    • plink.exe
    • pagent.exe
    • puttygen.exe
  2. Put these executable into a directory and add this directory into PATH environment
  3. Try to connect with Linux machine with putty.exe
    • A typical hostname is e33.cs.rochester.edu
    • The Linux Machine must be alive and connected to network
    • The Linux Machine must be running sshd
    • This time, you need username and password to gain access, but after following steps, you don't need username and password to access more safely
  4. Try to geek around putty.exe and you may find following options useful,
    • Session/Save sessions: Give a name to all of your setting and save it. The session name is important to fully utilise putty's convenience. Let's say you saved a session named 'e33'
    • Windows/Translation/Remote character set: Set this option to UTF-8 or anything else that is default to your Linux SSH Server (In the URCS department, UTF-8 is the defaulto encoding). Without setting the encoding correctly, you may find 'garbage characters' in the output of gcc
    • Connection/Data/Auto-login username: save your time to input a username and it's important for the convinience brought by putty
    • Connection/Data/Termimal details/Terminal-type string: This can be useful for vim users to setup vimrc correctly. What I am using for this option is 'xterm-256color'
    • Connection/SSH/Auth/Allow agent forwarding: can be useful if you understand this and this HOW-TO article will help you understand it

Access With RSA

With above steps, you should be able to access the Linux machine with username and password. However, it can be tedious to input password everytime. It can be of huge help if we can input password one time and access with one click. Now, I'll show you how.

  1. Run puttygen.exe you just downloaded
    1. Generate a public key / private key pair by clicking Generate. You may need to moving around in the blank box to progress
    2. Publick key, started with 'ssh-rsa', shows in the upper static text box.
    3. You need to input Key passphrase and remember it.
    4. Save private key to a safe place. Actually, You don't need to concern much about the safty of this file. Any access to this file needs the Key passphrase you just input, so you may want to put it into a place that is easy to be accessed, such as Dropbox or Google Drive.
  2. Login into the linux machine using username and password.
  3. Add the public key into ~/.ssh/authorized_keys
    1. If this file doesn't exist, just create one
    2. The public key should be one line started by ssh-rsa. Following is a typical public key, don't use it, use the one you created instead. Also, notice that there is
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAir7Bc3y+kwzQz1NMZUVRevViCIowtoQ3RJ4KhX823l5PQj7fHSdx1xoVvg2dYTBkqVkptbj0hmefaMXf9easPKYj0MC2+1E8ad08TdRr9dWdQYcjeTGPQWw+62bysJAs49OyjmyxKLat4ONbzpPCA59LOi5Ak0Gc0x8+ahMF65c= rsa-key-20130331

Github