Difference between revisions of "PuTTY"

From Computer Science
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
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:
 
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:
[[File:Putty_Icon.png|thumb|The putty desktop icon]]
+
 
 +
[[File:Putty_Icon.png|The putty desktop icon]]
 +
 
 
on your desktop.
 
on your desktop.
  
Line 10: Line 12:
  
 
The first time you run PuTTY, you will be prompted with a security warning:
 
The first time you run PuTTY, you will be prompted with a security warning:
 +
 +
[[File:Security.png]]
  
 
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.
 
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:
 
When you start PuTTY you will be presented with the Configuration menu:
 +
 +
[[File:Putty1.png|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.
 
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.
Line 24: Line 30:
  
 
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.
 
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.
 +
 +
[[File:Putty-Key.png|Accepting the Host Key]]
  
 
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.
 
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.
 
Once connected you will see a terminal window with a "login as:" prompt, enter your CS account username at the prompt and hit enter.
 +
 +
[[File:Terminal.png|The Terminal Window]]
  
 
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.
 
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.
Line 33: Line 43:
 
== Using the terminal interface ==
 
== 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.
+
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 disappears 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.
 
When you are done with your session use the "logout" or "exit" commands to end your session. Your PuTTY screen should then close.
Line 41: Line 51:
 
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.
 
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.
+
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.
 +
 
 +
[[File:Regedit.png|The Windows Registry Editor]]
  
 
== X Windows with Xming via PuTTY ==
 
== 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:
 
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
+
[http://cs.indstate.edu/FAQ/PuTTY/Xming/Xming-fonts-7-5-0-93-setup.exe Xming-fonts-7-5-0-93-setup.exe]
 +
 
 +
[http://cs.indstate.edu/FAQ/PuTTY/Xming/Xming-mesa-6-9-0-31-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.
 
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.
Line 54: Line 68:
  
 
When installing the Xming server, you do not need most of the extras as you already have PuTTY installed.
 
When installing the Xming server, you do not need most of the extras as you already have PuTTY installed.
 +
 +
[[File:Xming-Install.png|The Xming Installer]]
  
 
Once you have completed installation you may have a desktop icon that looks like:
 
Once you have completed installation you may have a desktop icon that looks like:
 +
 +
[[File:Xming-Icon.png|The Xming Desktop Icon]]
  
 
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.
 
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.
 +
 +
[[File:Xming-running.png|The windows toolbar]]
  
 
To stop the X server, open the hidden icon menu and right click on the Xming icon and select "Exit".
 
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.
 
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.
 +
 +
[[File:X-forward.png|Enabling X Forwarding in PuTTY]]
  
 
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.
 
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.

Latest revision as of 18:16, 29 August 2018

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:

Security.png

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:

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.

Accepting the Host Key

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.

The Terminal Window

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 disappears 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.

The Windows Registry Editor

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.

The Xming Installer

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

The Xming Desktop Icon

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.

The windows 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.

Enabling X Forwarding in PuTTY

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.