PuTTY

From Computer Science
Revision as of 18:00, 29 August 2018 by Root (talk | contribs)
Jump to: navigation, search

Quick PuTTY Howto

Download and Install

Use a web browser to browse to http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and click on the "putty.exe" link for "Windows on Intel x86". Save the file executable to your desktop (you may have to move it from your downloads directory to your desktop if you use Firefox.) You should then see an icon like: The putty desktop icon on your desktop.

Startup and Configuration

The first time you run PuTTY, you will be prompted with a security warning:

Un-check the "Always ask before opening this file" to never see the warning again. Then click "Run" to run PuTTY for the first time.

When you start PuTTY you will be presented with the Configuration menu:

Under the Terminal/Keyboard settings, change the Backspace key to send "Control-H". You may want to change the font size (set under Window/Appearance) or the default number of rows and columns to display (set under Window). Any changes you would like to make permanent will need to be saved as a session under the Saved Session menu (under "Session", the first menu you see when you start PuTTY), by either creating a new session or clicking on "Default settings" and then clicking the Save button.

If you're going to be connecting to cs.indstate.edu often, you may want to set it in the Host Name field before saving the default settings as well.

Connecting to cs.indstate.edu

The cs.indstate.edu server is the primary server for the CS department and which houses most of the accounts you will use. There may be other servers that you may be granted access to. To access the CS server, enter "cs.indstate.edu" into the Host Name (or IP address) field and make sure that the Port is "22" and the Connection type is "SSH", then click the "Open" button below to connect to the server.

Upon connecting the server for the first time you will be prompted with a PuTTY Security Alert box indicating that the host key hasn't been cached.

Click on the "Yes" button to accept the host key and continue to connect to the server. At some point it may be the case that the server is upgraded and the host key is changed. This message will appear again indicating that the new host key does not match the cached version. You will need to remove the cached key to eliminate this message. Read the instructions below to remove old cached host keys.

Once connected you will see a terminal window with a "login as:" prompt, enter your CS account username at the prompt and hit enter.

If you enter the wrong username or enter it incorrectly, you will have to close the window and restart PuTTY to try again. After entering your username, you will then be prompted for your password. You will not see anything as you type your password. Once you have successfully entered your password, you will be logged into the system and will be presented with a terminal prompt where you can enter Linux commands.

Using the terminal interface

PuTTY operates just like a normal X terminal or Konsole window that you might use in the Unix lab. PuTTY can be used with either a xterm or vt100 terminal type (set term=xterm or set term=vt100 if you use the tcsh shell or export TERM=xterm or export TERM=vt100 if you use bash.) To make your terminal type permanent, edit your ~/.cshrc (tcsh) or ~/.bashrc (bash). Some commands will output to an "alternate" screen when the xterm terminal type is selected, such as "less", which dissapears when the program exits. This can be annoying if you want the output to remain on the screen after you close the program. Using vt100 for your terminal type will usually prevent these programs from using this alternate screen, at the cost of some additional features provided by the xterm terminal type, such as additional colors and the ability to use your mouse. However, you may also be able to use "xterm1" which should give you all the normal xterm capabilities without the alternate screen.

When you are done with your session use the "logout" or "exit" commands to end your session. Your PuTTY screen should then close.

Removing Stored SSH keys

To remove old cached host keys from PuTTY you will need to use the Windows Registry Editor (regedit.exe), which you will have to use the start menu to search for and run.

Browse the registry to the Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys section and right click and select "Delete" all entries that end with the name of the problem host.

X Windows with Xming via PuTTY

X Windows applications can be run through the network via PuTTY if one has a working X server installed on their Window machine. To use X on Windows download and install the Xming X server and fonts provided here: Xming-fonts-7-5-0-93-setup.exe Xming-mesa-6-9-0-31-setup.exe

Or from http://www.straightrunning.com/xmingnotes/ Select the Xming-fonts and the Xming-mesa packages found under the "Public Domain Releases" section for the free version of Xming.

When installing the fonts, you probably do not need the Cryrillic fonts, but you should install all the rest.

When installing the Xming server, you do not need most of the extras as you already have PuTTY installed.

Once you have completed installation you may have a desktop icon that looks like:

When you start Xming you likely will not see anything (except the standard Windows security message the first time you run Xming. You can see that the X server is running by looking at the hidden icons in the lower right side of your desktop toolbar.

To stop the X server, open the hidden icon menu and right click on the Xming icon and select "Exit".

While the X server is running PuTTY can be used to run X windows applications by forwarding the X. To forward X11 connections in PuTTY, in the configuration menu, go to Connection\SSH\X11 and click the "Enable X11 Forwarding" checkbox.

Then you can connect to cs.indstate.edu and run X11 applications. Note that X requires a high-bandwidth, low-latency connection and probably will not work suitably over a slow internet connection. X works best on local networks.