PuTTY User Manual
PuTTY User Manual
SSH, Telnet and Rlogin are three ways of doing the same
thing: logging in to a multi-user computer from another
computer, over a network.
SSH, Telnet and Rlogin are network protocols that allow you
to do this. On the computer you sit at, you run a client,
which makes a network connection to the other computer
(the server). The network connection carries your
keystrokes and commands from the client to the server, and
carries the server's responses back to you.
If your client and server are both behind the same (good)
firewall, it is more likely to be safe to use Telnet or Rlogin,
but we still recommend you use SSH.
Chapter 2: Getting started with PuTTY
This chapter gives a quick guide to the simplest types of
interactive login session using PuTTY.
In the ‘Host Name’ box, enter the Internet host name of the
server you want to connect to. You should have been told
this by the provider of your login account.
While you are typing your password, you will not usually
see the cursor moving in the window, but PuTTY is
registering what you type, and will send it when you press
Return. (It works this way to avoid revealing the length of
your password to anyone watching your screen.)
You can close a PuTTY session using the Close button in the
window border, but this might confuse the server - a bit like
hanging up a telephone unexpectedly in the middle of a
conversation. We recommend you do not do this unless the
server has stopped responding to you and you cannot close
the window any other way.
Chapter 3: Using PuTTY
This chapter provides a general introduction to some more
advanced features of PuTTY. For extreme detail and
reference purposes, chapter 4 is likely to contain more
information.
Pasting into PuTTY is done using the right button (or the
middle mouse button, if you have a three-button mouse and
have set it up; see section 4.11.1). (Pressing Shift-Ins, or
selecting ‘Paste’ from the Ctrl+right-click context menu,
have the same effect.) When you click the right mouse
button, PuTTY will read whatever is in the Windows
clipboard and paste it into your session. By default, this
behaves exactly as if the clipboard contents had been typed
at the keyboard; therefore, be careful of pasting formatted
text into an editor that does automatic indenting, as you
may find that the spaces pasted from the clipboard plus the
spaces added by the editor add up to too many spaces and
ruin the formatting. (Some remote applications can ask
PuTTY to identify text that is being pasted, to avoid this sort
of problem; but if your application does not, there is
nothing PuTTY can do to avoid this.)
By default the last 2000 lines scrolled off the top are
preserved for you to look at. You can increase (or decrease)
this value using the configuration box; see section 4.7.3.
3.1.3 The System menu
If you click the left mouse button on the icon in the top left
corner of PuTTY's terminal window, or click the right mouse
button on the title bar, you will see the standard Windows
system menu containing items like Minimise, Move, Size
and Close.
You can use the mouse to select one or more lines of the
Event Log, and hit the Copy button to copy them to the
clipboard. If you are reporting a bug, it's often useful to
paste the contents of the Event Log into your bug report.
(The Event Log is not the same as the facility to create a log
file of your session; that's described in section 3.2.)
3.1.3.2 Special commands
Depending on the protocol used for the current session,
there may be a submenu of ‘special commands’. These are
protocol-specific tokens, such as a ‘break’ signal, that can
be sent down a connection in addition to normal data. Their
precise effect is usually up to the server. Currently only
Telnet, SSH, and serial connections have special commands.
IGNORE message
Break
Erase Line
Go Ahead
No Operation
Abort Process
Abort Output
Interrupt Process
Suspend Process
End Of Record
End Of File
When you are in full-screen mode, you can still access the
system menu if you click the left mouse button in the
extreme top left corner of the screen.
3.2 Creating a log file of your session
For some purposes you may find you want to log everything
that appears on your screen. You can do this using the
‘Logging’ panel in the configuration box.
You should then tick the ‘Enable X11 forwarding’ box in the
X11 panel (see section 4.26) before starting your SSH
session. The ‘X display location’ box is blank by default,
which means that PuTTY will try to use a sensible default
such as :0, which is the usual display location where your X
server will be installed. If that needs changing, then change
it.
Now start your session and log in. (Port forwarding will not
be enabled until after you have logged in; otherwise it
would be easy to perform completely anonymous network
attacks, and gain access to anyone's virtual private
network.) To check that PuTTY has set up the port
forwarding correctly, you can look at the PuTTY Event Log
(see section 3.1.3.1). It should say something like this:
2001-12-05 17:22:10 Local port 3110 forwarding to
popserver.example.com:110
After you start up PuTTY in serial mode, you might find that
you have to make the first move, by sending some data out
of the serial line in order to notify the device at the other
end that someone is there for it to talk to. This probably
depends on the device. If you start up a PuTTY serial
session and nothing appears in the window, try pressing
Return a few times and see if that helps.
Note that the -pw option only works when you are using the
SSH protocol. Due to fundamental limitations of Telnet and
Rlogin, these protocols do not support automated password
authentication.
3.8.3.9 -agent and -noagent: control use
of Pageant for authentication
The -agent option turns on SSH authentication using
Pageant, and -noagent turns it off. These options are only
meaningful if you are using SSH.
If you are using Pageant, you can also specify a public key
file (in RFC 4716 or OpenSSH format) to identify a specific
key file to use. (This won't work if you're not running
Pageant, of course.)
You can specify this option more than once if you want to
configure more than one key to be accepted.
3.8.3.21 -pgpfp: display PGP key
fingerprints
This option causes the PuTTY tools not to run as normal, but
instead to display the fingerprints of the PuTTY PGP Master
Keys, in order to aid with verifying new versions. See
appendix E for more information.
3.8.3.22 -sercfg: specify serial port
configuration
This option specifies the configuration parameters for the
serial port (baud rate, stop bits etc). Its argument is
interpreted as a comma-separated list of configuration
options, which can be as follows:
If you need to store them in a file, you could try the method
described in section 4.30.
4.1.3 ‘Close window on exit’
Finally in the Session panel, there is an option labelled
‘Close window on exit’. This controls whether the PuTTY
terminal window disappears as soon as the session inside it
terminates. If you are likely to want to copy and paste text
out of the session after it has terminated, or restart the
session, you should arrange for this option to be off.
There are a few special features in this box. If you use the &
character in the file name box, PuTTY will insert details of
the current session in the name of the file it actually opens.
The precise replacements it will do are:
log-server1.example.com-20010528-110859.dat
log-unixbox.somewhere.org-20010611-221001.dat
4.2.2 ‘What to do if the log file
already exists’
This control allows you to specify what PuTTY should do if it
tries to start writing to a log file and it finds the file already
exists. You might want to automatically destroy the existing
log file and start a new one with the same name.
Alternatively, you might want to open the existing log file
and add data to the end of it. Finally (the default option),
you might not want to have any automatic behaviour, but to
ask the user every time the problem comes up.
4.2.3 ‘Flush log file frequently’
This option allows you to control how frequently logged data
is flushed to disc. By default, PuTTY will flush data as soon
as it is displayed, so that if you view the log file while a
session is still open, it will be up to date; and if the client
system crashes, there's a greater chance that the data will
be preserved.
Note that this will only omit data that PuTTY knows to be a
password. However, if you start another login session within
your PuTTY session, for instance, any password used will
appear in the clear in the packet log. The next option may
be of use to protect against this.
With auto wrap mode on, if a long line of text reaches the
right-hand edge, it will wrap over on to the next line so you
can still see all the text. With auto wrap mode off, the
cursor will stay at the right-hand edge of the screen, and all
the characters in the line will be printed on top of each
other.
Some servers only send CR, and so the newly written line is
overwritten by the following line. This option causes a line
feed so that all lines are displayed.
4.3.5 ‘Use background colour to erase
screen’
Not all terminals agree on what colour to turn the screen
when the server sends a ‘clear screen’ sequence. Some
terminals believe the screen should always be cleared to the
default background colour. Others believe the screen should
be cleared to whatever the server has selected as a
background colour.
Note that this is not the feature of PuTTY which the server
will typically use to determine your terminal type. That
feature is the ‘Terminal-type string’ in the Connection panel;
see section 4.15.3 for details.
If you enable local line editing, this changes. PuTTY will let
you edit a whole line at a time locally, and the line will only
be sent to the server when you press Return. If you make a
mistake, you can use the Backspace key to correct it before
you press Return, and the server will never see the mistake.
xterm,and other terminals, send ESC [1~ for the Home key,
and ESC [4~ for the End key. rxvt sends ESC [H for the Home
key and ESC [Ow for the End key.
Note that even if the application takes over the mouse, you
can still manage PuTTY's copy and paste by holding down
the Shift key while you select and paste, unless you have
deliberately turned this feature off (see section 4.11.2).
4.6.3 Disabling remote terminal
resizing
PuTTY has the ability to change the terminal's size and
position in response to commands from the server. If you
find PuTTY is doing this unexpectedly or inconveniently, you
can tell PuTTY not to respond to those server commands.
4.6.4 Disabling switching to the
alternate screen
Many terminals, including PuTTY, support an ‘alternate
screen’. This is the same size as the ordinary terminal
screen, but separate. Typically a screen-based program
such as a text editor might switch the terminal to the
alternate screen before starting up. Then at the end of the
run, it switches back to the primary screen, and you see the
screen contents just as they were before starting the editor.
‘None’
PuTTY makes no response whatsoever to the relevant
escape sequence. This may upset server-side software
that is expecting some sort of response.
‘Empty string’
PuTTY makes a well-formed response, but leaves it
blank. Thus, server-side software that expects a
response is kept happy, but an attacker cannot
influence the response string. This is probably the
setting you want if you have no better ideas.
‘Window title’
PuTTY responds with the actual window title. This is
dangerous for the reasons described above.
4.6.7 Disabling remote scrollback
clearing
PuTTY has the ability to clear the terminal's scrollback
buffer in response to a command from the server. If you
find PuTTY is doing this unexpectedly or inconveniently, you
can tell PuTTY not to respond to that server command.
4.6.8 Disabling destructive backspace
Normally, when PuTTY receives character 127 (^?) from the
server, it will perform a ‘destructive backspace’: move the
cursor one space left and delete the character under it. This
can apparently cause problems in some applications, so
PuTTY provides the ability to configure character 127 to
perform a normal backspace (without deleting a character)
instead.
4.6.9 Disabling remote character set
configuration
PuTTY has the ability to change its character set
configuration in response to commands from the server.
Some programs send these commands unexpectedly or
inconveniently. In particular, BitchX (an IRC client) seems to
have a habit of reconfiguring the character set to something
other than the user intended.
You may also find you need to disable Arabic text shaping;
see section 4.6.10.
4.7 The Window panel
The Window configuration panel allows you to control
aspects of the PuTTY window.
The ‘Cursor blinks’ option makes the cursor blink on and off.
This works in any of the cursor modes.
4.8.2 Controlling the font used in the
terminal window
This option allows you to choose what font, in what size, the
PuTTY terminal window uses to display the text in the
session.
If you use legacy CJK applications, and you find your lines
are wrapping in the wrong places, or you are having other
display problems, you might want to play with this setting.
This option only has any effect in UTF-8 mode (see section
4.10.1).
4.10.3 ‘Caps Lock acts as Cyrillic
switch’
This feature allows you to switch between a US/UK
keyboard layout and a Cyrillic keyboard layout by using the
Caps Lock key, if you need to type (for example) Russian
and English side by side in the same document.
However, not all applications will see it that way. Even UTF-
8 terminal users will still sometimes have to run software
that tries to print line-drawing characters in the old-
fashioned way. So the configuration option ‘Enable VT100
line drawing even in UTF-8 mode’ puts PuTTY into a hybrid
mode in which it understands the VT100-style control
sequences that change the meaning of the ASCII lower case
letters, and understands UTF-8.
4.11 The Selection panel
The Selection panel allows you to control the way copy and
paste work in the PuTTY window.
If you are not getting the colours you ask for on an 8-bit
display, you can try enabling this option. However, be
warned that it's never worked very well.
4.13.6 ‘Use system colours’
Enabling this option will cause PuTTY to ignore the
configured colours for ‘Default Background/Foreground’ and
‘Cursor Colour/Text’ (see section 4.13.7), instead going with
the system-wide defaults.
Note that non-bold and bold text will be the same colour if
this option is enabled. You might want to change to
indicating bold text by font changes (see section 4.13.4).
4.13.7 Adjusting the colours in the
terminal window
The main colour control allows you to specify exactly what
colours things should be displayed in. To modify one of the
PuTTY colours, use the list box to select which colour you
want to modify. The RGB values for that colour will appear
on the right-hand side of the list box. Now, if you press the
‘Modify’ button, you will be presented with a colour selector,
in which you can choose a new colour to go in place of the
old one. (You may also edit the RGB values directly in the
edit boxes, if you wish; each value is an integer from 0 to
255.)
Note that keepalives are not always helpful. They help if you
have a firewall which drops your connection after an idle
period; but if the network between you and the server
suffers from breaks in connectivity then keepalives can
actually make things worse. If a session is idle, and
connectivity is temporarily lost between the endpoints, but
the connectivity is restored before either side tries to send
anything, then there will be no problem - neither endpoint
will notice that anything was wrong. However, if one side
does send something during the break, it will repeatedly try
to re-send, and eventually give up and abandon the
connection. Then when connectivity is restored, the other
side will find that the first side doesn't believe there is an
open connection any more. Keepalives can make this sort of
problem worse, because they increase the probability that
PuTTY will attempt to send data during a break in
connectivity. (Other types of periodic network activity can
cause this behaviour; in particular, SSH-2 re-keys can have
this effect. See section 4.20.2.)
Note that if you are using SSH-1 and the server has a bug
that makes it unable to deal with SSH-1 ignore messages
(see section 4.28.11), enabling keepalives will have no
effect.
4.14.2 ‘Disable Nagle's algorithm’
Nagle's algorithm is a detail of TCP/IP implementations that
tries to minimise the number of small data packets sent
down a network connection. With Nagle's algorithm
enabled, PuTTY's bandwidth usage will be slightly more
efficient; with it disabled, you may find you get a faster
response to your keystrokes when connecting to some types
of server.
You might use this, for instance, if you had set up an SSH
port forwarding in one PuTTY session so that connections to
some arbitrary port (say, localhost port 10022) were
forwarded to a second machine's SSH port (say, foovax port
22), and then started a second PuTTY connecting to the
forwarded port.
In normal usage, the second PuTTY will access the host key
cache under the host name and port it actually connected to
(i.e. localhost port 10022 in this example). Using the logical
host name option, however, you can configure the second
PuTTY to cache the host key under the name of the host
you know that it's really going to end up talking to (here
foovax).
If you just enter a host name for this option, PuTTY will
cache the SSH host key under the default SSH port for that
host, irrespective of the port you really connected to (since
the typical scenario is like the above example: you connect
to a silly real port number and your connection ends up
forwarded to the normal port-22 SSH server of some other
machine). To override this, you can append a port number
to the logical host name, separated by a colon. E.g.
entering ‘foovax:2200’ as the logical host name will cause the
host key to be cached as if you had connected to port 2200
of foovax.
Note that if you are doing DNS at the proxy, you should
make sure that your proxy exclusion settings (see section
4.16.2) do not depend on knowing the IP address of a host.
If the name is passed on to the proxy without PuTTY looking
it up, it will never know the IP address and cannot check it
against your list.
Note that if you save your session, the proxy password will
be saved in plain text, so anyone who can access your
PuTTY configuration data will be able to discover it.
If you are using the Local proxy type, the local command to
run is specified here.
This will send your username and password as the first two
lines to the proxy, followed by a command to connect to the
desired host and port. Note that if you do not include the
%user or %pass tokens in the Telnet command, then the
‘Username’ and ‘Password’ configuration fields will be
ignored.
4.16.6 Controlling proxy logging
Often the proxy interaction has its own diagnostic output;
this is particularly the case for local proxy commands.
Note that most servers will close the session after executing
the command.
4.19.2 ‘Don't start a shell or
command at all’
If you tick this box, PuTTY will not attempt to run a shell or
command after connecting to the remote server. You might
want to use this option if you are only using the SSH
connection for port forwarding, and your user account on
the server does not have the ability to run a shell.
The upstream PuTTY can therefore not terminate until all its
downstreams have closed. This is similar to the effect you
get with port forwarding or X11 forwarding, in which a
PuTTY whose terminal session has already finished will still
remain open so as to keep serving forwarded connections.
If PuTTY already has one or more host keys stored for the
server, it will prefer to use one of those, even if the server
has a key type that is higher in the preference order. You
can add such a key to PuTTY's cache from within an existing
session using the ‘Special Commands’ menu; see section
3.1.3.2.
If the first key type PuTTY finds is below the ‘warn below
here’ line, you will see a warning box when you make the
connection, similar to that for cipher selection (see section
4.22).
4.21.2 Manually configuring host keys
In some situations, if PuTTY's automated host key
management is not doing what you need, you might need
to manually configure PuTTY to accept a specific host key,
or one of a specific set of host keys.
To configure manual host keys via the GUI, enter some text
describing the host key into the edit box in the ‘Manually
configure host keys for this connection’ container, and press
the ‘Add’ button. The text will appear in the ‘Host keys or
fingerprints to accept’ list box. You can remove keys again
with the ‘Remove’ button.
The text describing a host key can be in one of the following
formats:
This is not the option you want if you have a username and
just want PuTTY to remember it; for that see section 4.15.1.
It's also probably not what if you're trying to set up
passwordless login to a mainstream SSH server; depending
on the server, you probably wanted public-key
authentication (chapter 8) or perhaps GSSAPI
authentication (section 4.24). (These are still forms of
authentication, even if you don't have to interact with
them.)
For this reason, PuTTY will by default not prompt you for
your username more than once, in case the server
complains. If you know your server can cope with it, you
can enable the ‘Allow attempted changes of username’
option to modify PuTTY's behaviour.
4.23.8 ‘Private key file for
authentication’
This box is where you enter the name of your private key
file if you are using public key authentication. See chapter 8
for information about public key authentication in SSH.
The Bugs and More Bugs panels (there are two because we
have so many bug compatibility modes) allow you to
manually configure the bugs PuTTY expects to see in the
server. Each bug can be configured in three states:
‘Off’: PuTTY will assume the server does not have the
bug.
‘On’: PuTTY will assume the server does have the bug.
‘Auto’: PuTTY will use the server's version number
announcement to try to guess whether or not the server
has the bug.
You will need a file called (say) PUTTY.BAT which imports the
contents of a file into the Registry, then runs PuTTY, exports
the contents of the Registry back into the file, and deletes
the Registry entries. This can all be done using the Regedit
command line options, so it's all automatic. Here is what
you need in PUTTY.BAT:
@ECHO OFF
regedit /s putty.reg
regedit /s puttyrnd.reg
start /w putty.exe
regedit /ea new.reg HKEY_CURRENT_USER\Software\SimonTatham\PuTTY
copy new.reg putty.reg
del new.reg
regedit /s puttydel.reg
Here is PUTTYDEL.REG:
REGEDIT4
[-HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
"RandSeedFile"="a:\\putty.rnd"
You should replace a:\putty.rnd with the location where you
want to store your random number data. If the aim is to
carry around PuTTY and its settings on one USB stick, you
probably want to store it on the USB stick.
Chapter 5: Using PSCP to transfer
files securely
PSCP, the PuTTY Secure Copy client, is a tool for
transferring files securely between computers using an SSH
connection.
This will only work for the lifetime of that particular console
window. To set your PATH more permanently on Windows NT,
2000, and XP, use the Environment tab of the System
Control Panel. On Windows 95, 98, and ME, you will need to
edit your AUTOEXEC.BAT to include a set command like the one
above.
5.2 PSCP Usage
Once you've got a console window to type into, you can just
type pscp on its own to bring up a usage message. This tells you
the version of PSCP you're using, and gives you a brief
summary of how to use PSCP:
Z:\owendadmin>pscp
PuTTY Secure Copy client
Release 0.73
Usage: pscp [options] [user@]host:source target
pscp [options] source [source...] [user@]host:target
pscp [options] -ls [user@]host:filespec
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-p preserve file attributes
-q quiet, don't show statistics
-r copy directories recursively
-v show verbose messages
-load sessname Load settings from saved session
-P port connect to specified port
-l user connect with specified username
-pw passw login with specified password
-1 -2 force use of particular SSH protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for user authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-hostkey aa:bb:cc:...
manually specify a host key (may be repeated)
-batch disable all interactive prompts
-no-sanitise-stderr don't strip control chars from standard error
-proxycmd command
use 'command' as local proxy
-unsafe allow server-side wildcards (DANGEROUS)
-sftp force use of SFTP protocol
-scp force use of SCP protocol
-sshlog file
-sshrawlog file
log protocol details to a file
This will suppress the warning message and the file transfer
will happen. However, you should be aware that by using
this option you are giving the server the ability to write to
any file in the target directory, so you should only use this
option if you trust the server administrator not to be
malicious (and not to let the server machine be cracked by
malicious people). Alternatively, do any such download in a
newly created empty directory. (Even in ‘unsafe’ mode,
PSCP will still protect you against the server trying to get
out of that directory using pathnames including ‘..’.)
5.2.1.1 user
5.2.1.2 host
5.2.1.3 source
5.2.1.4 target
5.2.1.1 user
The -scp option forces PSCP to use the SCP protocol or quit.
or perhaps
psftp [email protected]
cd /home/ftp/users/jeff
del jam-old.tar.gz
ren jam.tar.gz jam-old.tar.gz
put jam.tar.gz
chmod a+r jam.tar.gz
When you run a batch script in this way, PSFTP will abort
the script if any command fails to complete successfully. To
change this behaviour, you can add the -be option (section
6.1.3).
Once you have issued this command, you will not be able to
issue it again, even if the command fails (for example, if
you mistype the host name or the connection times out). So
if the connection is not opened successfully, PSFTP will
terminate immediately.
6.2.4 The quit command: end your
session
When you have finished your session, type the command
quit to close the connection, terminate PSFTP and return to
the command line (or just close the PSFTP console window
if you started it from the GUI).
You can also use the bye and exit commands, which have
exactly the same effect.
6.2.5 The close command: close your
connection
If you just want to close the network connection but keep
PSFTP running, you can use the close command. You can
then use the open command to open a new connection.
6.2.6 The help command: get quick
online help
If you type help, PSFTP will give a short list of the available
commands.
In its simplest form, you just use this with a file name:
get myfile.dat
This will fetch the file on the server called myfile.dat, but will
save it to your local machine under the name newname.dat.
In its simplest form, you just use this with a file name:
put myfile.dat
This will send the local file called myfile.dat, but will store it
on the server under the name newname.dat.
The -r and -- options from get are also available with mget.
In addition to all this, there are a few extra special cases for
Unix systems. On non-Unix systems these are unlikely to be
useful:
You can specify u+s and u-s to add or remove the Unix
set-user-ID bit. This is typically only useful for special
purposes; refer to your Unix documentation if you're
not sure about it.
You can specify g+s and g-s to add or remove the Unix
set-group-ID bit. On a file, this works similarly to the
set-user-ID bit (see your Unix documentation again); on
a directory it ensures that files created in the directory
are accessible by members of the group that owns the
directory.
You can specify +t and -t to add or remove the Unix
‘sticky bit’. When applied to a directory, this means that
the owner of a file in that directory can delete the file
(whereas normally only the owner of the directory
would be allowed to).
6.2.15 The del command: delete
remote files
To delete a file on the server, type del and then the filename
or filenames:
del oldfile.dat
del file1.txt file2.txt
del *.o
You can also move the file into a different directory and
change the name:
mv oldfile dir/newname
The rename and ren commands work exactly the same way as
mv.
6.2.19 The ! command: run a local
Windows command
You can run local Windows commands using the !
command. This is the only PSFTP command that is not
subject to the command quoting rules given in section
6.2.1. If any command line begins with the ! character, then
the rest of the line will be passed straight to Windows
without further translation.
This will only work for the lifetime of that particular console
window. To set your PATH more permanently on Windows NT,
2000, and XP, use the Environment tab of the System
Control Panel. On Windows 95, 98, and ME, you will need to
edit your AUTOEXEC.BAT to include a set command like the one
above.
7.2 Using Plink
This section describes the basics of how to use Plink for interactive logins
and for automated processes.
Once you've got a console window to type into, you can just type plink
on its own to bring up a usage message. This tells you the version of
Plink you're using, and gives you a brief summary of how to use Plink:
Z:\sysosd>plink
Plink: command-line connection utility
Release 0.73
Usage: plink [options] [user@]host [command]
("host" can also be a PuTTY saved session name)
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-v show verbose messages
-load sessname Load settings from saved session
-ssh -telnet -rlogin -raw -serial
force use of a particular protocol
-P port connect to specified port
-l user connect with specified username
-batch disable all interactive prompts
-proxycmd command
use 'command' as local proxy
-sercfg configuration-string (e.g. 19200,8,n,1,X)
Specify the serial configuration (serial only)
The following options only apply to SSH connections:
-pw passw login with specified password
-D [listen-IP:]listen-port
Dynamic SOCKS-based port forwarding
-L [listen-IP:]listen-port:host:port
Forward local port to remote address
-R [listen-IP:]listen-port:host:port
Forward remote port to local address
-X -x enable / disable X11 forwarding
-A -a enable / disable agent forwarding
-t -T enable / disable pty allocation
-1 -2 force use of particular protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for user authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-noshare disable use of connection sharing
-share enable use of connection sharing
-hostkey aa:bb:cc:...
manually specify a host key (may be repeated)
-sanitise-stderr, -sanitise-stdout, -no-sanitise-stderr, -no-sanitise-stdout
do/don't strip control chars from standard output/error
-no-antispoof omit anti-spoofing prompt after authentication
-m file read remote command(s) from file
-s remote command is an SSH subsystem (SSH-2 only)
-N don't start a shell/command (SSH-2 only)
-nc host:port
open tunnel in place of session (SSH-2 only)
-sshlog file
-sshrawlog file
log protocol details to a file
-shareexists
test whether a connection-sharing upstream exists
To avoid being prompted for the server host key when using
Plink for an automated connection, you should first make a
manual connection (using either of PuTTY or Plink) to the
same server, verify the host key (see section 2.2 for more
information), and select Yes to add the host key to the
Registry. After that, Plink commands connecting to that
server should not give a host key prompt unless the host
key changes.
Once you have done all this, you should be able to run a
remote command on the SSH server machine and have it
execute automatically with no prompting:
Z:\sysosd>plink login.example.com -l fred echo hello, world
hello, world
Z:\sysosd>
Z:\sysosd>
Select the folder you want to check out to with the ‘Change
Folder’ button, and click ‘OK’ to check out your module.
Once you've got modules checked out, WinCVS will happily
invoke plink from the GUI for CVS operations.
Chapter 8: Using public keys for SSH
authentication
8.1 Public key authentication - an introduction
8.2 Using PuTTYgen, the PuTTY key generator
8.2.1 Generating a new key
8.2.2 Selecting the type of key
8.2.3 Selecting the size (strength) of the key
8.2.4 The ‘Generate’ button
8.2.5 The ‘Key fingerprint’ box
8.2.6 Setting a comment for your key
8.2.7 Setting a passphrase for your key
8.2.8 Saving your private key to a disk file
8.2.9 Saving your public key to a disk file
8.2.10 ‘Public key for pasting into OpenSSH
authorized_keys file’
8.2.11 Reloading a private key
8.2.12 Dealing with private keys in other formats
8.3 Getting ready for public key authentication
8.1 Public key authentication - an
introduction
Public key authentication is an alternative means of
identifying yourself to a login server, instead of typing a
password. It is more secure and more flexible, but more
difficult to set up.
When you run PuTTYgen you will see a window where you
have two main choices: ‘Generate’, to generate a new
public/private key pair, or ‘Load’ to load in an existing
private key.
Your key pair is now ready for use. You may also want to
copy the public key to your server, either by copying it out
of the ‘Public key for pasting into OpenSSH authorized_keys
file’ box (see section 8.2.10), or by using the ‘Save public
key’ button (section 8.2.9). However, you don't need to do
this immediately; if you want, you can load the private key
back into PuTTYgen later (see section 8.2.11) and the public
key will be available for copying and pasting again.
First, a progress bar will appear and PuTTYgen will ask you
to move the mouse around to generate randomness. Wave
the mouse in circles over the blank area in the PuTTYgen
window, and the progress bar will gradually fill up as
PuTTYgen collects enough randomness. You don't need to
wave the mouse in particularly imaginative patterns
(although it can't hurt); PuTTYgen will collect enough
randomness just from the fine detail of exactly how far the
mouse has moved each time Windows samples its position.
To alter the key comment, just type your comment text into
the ‘Key comment’ box before saving the private key. If you
want to change the comment later, you can load the private
key back into PuTTYgen, change the comment, and save it
again.
8.2.7 Setting a passphrase for your
key
The ‘Key passphrase’ and ‘Confirm passphrase’ boxes allow
you to choose a passphrase for your key. The passphrase
will be used to encrypt the key on disk, so you will not be
able to use the key without first entering the passphrase.
When you save the key, PuTTYgen will check that the ‘Key
passphrase’ and ‘Confirm passphrase’ boxes both contain
exactly the same passphrase, and will refuse to save the
key otherwise.
You will then probably want to copy the public key file to
your SSH server machine. See section 8.3 for general
instructions on configuring public-key authentication once
you have generated a key.
If you use this option with an SSH-1 key, the file PuTTYgen
saves will contain exactly the same text that appears in the
‘Public key for pasting’ box. This is the only existing
standard for SSH-1 public keys.
8.2.10 ‘Public key for pasting into
OpenSSH authorized_keys file’
The OpenSSH server, among others, requires your public
key to be given to it in a one-line format before it will
accept authentication with your private key. (SSH-1 servers
also used this method.)
You may also need to ensure that your home directory, your
.ssh directory, and any other files involved (such as
authorized_keys, authorized_keys2 or authorization) are not
group-writable or world-writable; servers will typically
ignore the keys unless this is done. You can typically do this
by using a command such as
chmod go-w $HOME $HOME/.ssh $HOME/.ssh/authorized_keys
If you click the Pageant icon with the right mouse button,
you will see a menu. Select ‘View Keys’ from this menu. The
Pageant main window will appear. (You can also bring this
window up by double-clicking on the Pageant icon.)
When you want to shut down Pageant, click the right button
on the Pageant icon in the System tray, and select ‘Exit’
from the menu. Closing the Pageant main window does not
shut down Pageant.
9.2 The Pageant main window
The Pageant main window appears when you left-click on
the Pageant system tray icon, or alternatively right-click
and select ‘View Keys’ from the menu. You can use it to
keep track of what keys are currently loaded into Pageant,
and to add new ones or remove the existing keys.
You can apply this to keys you added using the ‘Add Key’
button, or to keys you added remotely using agent
forwarding (see section 9.4); it makes no difference.
9.3 The Pageant command line
Pageant can be made to do things automatically when it
starts up, by specifying instructions on its command line. If
you're starting Pageant from the Windows GUI, you can
arrange this by editing the properties of the Windows
shortcut that it was started from.
If you see this message, it means that PuTTY has not seen
this host key before, and has no way of knowing whether it
is correct or not. You should attempt to verify the host key
by other means, such as asking the machine's
administrator.
If you see this message and you know that your installation
of PuTTY has connected to the same server before, it may
have been recently upgraded to SSH protocol version 2.
SSH protocols 1 and 2 use separate host keys, so when you
first use SSH-2 with a server you have only used SSH-1
with before, you will see this message again. You should
verify the correctness of the key as before.
This can easily happen if you are using Pageant and have a
large number of keys loaded into it, since these servers
count each offer of a public key as an authentication
attempt. This can be worked around by specifying the key
that's required for the authentication in the PuTTY
configuration (see section 4.23.8); PuTTY will ignore any
other keys Pageant may have, but will ask Pageant to do
the authentication, so that you don't have to type your
passphrase.
This can happen in SSH-2, if PuTTY and the server have not
enabled encryption in the same way (see question A.7.3 in
the FAQ).
If you get this error, one thing you could try would be to
fiddle with the setting of ‘Miscomputes SSH-2 encryption
keys’ (see section 4.28.10) or ‘Ignores SSH-2 maximum
packet size’ (see section 4.28.5) on the Bugs panel.
10.14 ‘PuTTY X11 proxy: various
errors’
This family of errors are reported when PuTTY is doing X
forwarding. They are sent back to the X application running
on the SSH server, which will usually report the error to the
user.
We are not aware of any reason why this error might occur
that would represent a bug in PuTTY. The problem is
between you, your Windows system, your network and the
remote system.
10.16 ‘Network error: Connection
reset by peer’
This error occurs when the machines at each end of a
network connection lose track of the state of the connection
between them. For example, you might see it if your SSH
server crashes, and manages to reboot fully before you next
attempt to send data to it.
A.1 Introduction
A.1.1 What is PuTTY?
A.2 Features supported in PuTTY
A.2.1 Does PuTTY support SSH-2?
A.2.2 Does PuTTY support reading OpenSSH or
ssh.com SSH-2 private key files?
A.2.3 Does PuTTY support SSH-1?
A.2.4 Does PuTTY support local echo?
A.2.5 Does PuTTY support storing settings, so I
don't have to change them every time?
A.2.6 Does PuTTY support storing its settings in a
disk file?
A.2.7 Does PuTTY support full-screen mode, like a
DOS box?
A.2.8 Does PuTTY have the ability to remember my
password so I don't have to type it every time?
A.2.9 Is there an option to turn off the annoying
host key prompts?
A.2.10 Will you write an SSH server for the PuTTY
suite, to go with the client?
A.2.11 Can PSCP or PSFTP transfer files in ASCII
mode?
A.3 Ports to other operating systems
A.3.1 What ports of PuTTY exist?
A.3.2 Is there a port to Unix?
A.3.3 What's the point of the Unix port? Unix has
OpenSSH.
A.3.4 Will there be a port to Windows CE or
PocketPC?
A.3.5 Is there a port to Windows 3.1?
A.3.6 Will there be a port to the Mac?
A.3.7 Will there be a port to EPOC?
A.3.8 Will there be a port to the iPhone?
A.4 Embedding PuTTY in other programs
A.4.1 Is the SSH or Telnet code available as a DLL?
A.4.2 Is the SSH or Telnet code available as a Visual
Basic component?
A.4.3 How can I use PuTTY to make an SSH
connection from within another program?
A.5 Details of PuTTY's operation
A.5.1 What terminal type does PuTTY use?
A.5.2 Where does PuTTY store its data?
A.5.3 Why do small PuTTY icons appear next to the
login prompts?
A.5.4 Why has Plink started saying ‘Press Return to
begin session’?
A.6 HOWTO questions
A.6.1 What login name / password should I use?
A.6.2 What commands can I type into my PuTTY
terminal window?
A.6.3 How can I make PuTTY start up maximised?
A.6.4 How can I create a Windows shortcut to start
a particular saved session directly?
A.6.5 How can I start an SSH session straight from
the command line?
A.6.6 How do I copy and paste between PuTTY and
other Windows applications?
A.6.7 How do I use all PuTTY's features (public
keys, proxying, cipher selection, etc.) in PSCP,
PSFTP and Plink?
A.6.8 How do I use PSCP.EXE? When I double-click
it gives me a command prompt window which then
closes instantly.
A.6.9 How do I use PSCP to copy a file whose name
has spaces in?
A.6.10 Should I run the 32-bit or the 64-bit
version?
A.7 Troubleshooting
A.7.1 Why do I see ‘Fatal: Protocol error: Expected
control record’ in PSCP?
A.7.2 I clicked on a colour in the Colours panel, and
the colour didn't change in my terminal.
A.7.3 After trying to establish an SSH-2 connection,
PuTTY says ‘Out of memory’ and dies.
A.7.4 When attempting a file transfer, either PSCP
or PSFTP says ‘Out of memory’ and dies.
A.7.5 PSFTP transfers files much slower than PSCP.
A.7.6 When I run full-colour applications, I see
areas of black space where colour ought to be, or
vice versa.
A.7.7 When I change some terminal settings,
nothing happens.
A.7.8 My PuTTY sessions unexpectedly close after
they are idle for a while.
A.7.9 PuTTY's network connections time out too
quickly when network connectivity is temporarily
lost.
A.7.10 When I cat a binary file, I get
‘PuTTYPuTTYPuTTY’ on my command line.
A.7.11 When I cat a binary file, my window title
changes to a nonsense string.
A.7.12 My keyboard stops working once PuTTY
displays the password prompt.
A.7.13 One or more function keys don't do what I
expected in a server-side application.
A.7.14 Why do I see ‘Couldn't load private key from
...’? Why can PuTTYgen load my key but not PuTTY?
A.7.15 When I'm connected to a Red Hat Linux 8.0
system, some characters don't display properly.
A.7.16 Since I upgraded to PuTTY 0.54, the
scrollback has stopped working when I run screen.
A.7.17 Since I upgraded Windows XP to Service
Pack 2, I can't use addresses like 127.0.0.2.
A.7.18 PSFTP commands seem to be missing a
directory separator (slash).
A.7.19 Do you want to hear about ‘Software caused
connection abort’?
A.7.20 My SSH-2 session locks up for a few seconds
every so often.
A.7.21 PuTTY fails to start up. Windows claims that
‘the application configuration is incorrect’.
A.7.22 When I put 32-bit PuTTY in
C:\WINDOWS\SYSTEM32 on my 64-bit Windows system,
‘Duplicate Session’ doesn't work.
A.7.23 After I upgraded PuTTY to 0.68, I can no
longer connect to my embedded device or
appliance.
A.8 Security questions
A.8.1 Is it safe for me to download PuTTY and use it
on a public PC?
A.8.2 What does PuTTY leave on a system? How can
I clean up after it?
A.8.3 How come PuTTY now supports DSA, when
the website used to say how insecure it was?
A.8.4 Couldn't Pageant use VirtualLock() to stop
private keys being written to disk?
A.9 Administrative questions
A.9.1 Would you like me to register you a nicer
domain name?
A.9.2 Would you like free web hosting for the PuTTY
web site?
A.9.3 Would you link to my web site from the PuTTY
web site?
A.9.4 Why don't you move PuTTY to SourceForge?
A.9.5 Why can't I subscribe to the putty-bugs
mailing list?
A.9.6 If putty-bugs isn't a general-subscription
mailing list, what is?
A.9.7 How can I donate to PuTTY development?
A.9.8 Can I have permission to put PuTTY on a
cover disk / distribute it with other software / etc?
A.9.9 Can you sign an agreement indemnifying us
against security problems in PuTTY?
A.9.10 Can you sign this form granting us
permission to use/distribute PuTTY?
A.9.11 Can you write us a formal notice of
permission to use PuTTY?
A.9.12 Can you sign anything for us?
A.9.13 If you won't sign anything, can you give us
some sort of assurance that you won't make PuTTY
closed-source in future?
A.9.14 Can you provide us with export control
information / FIPS certification for PuTTY?
A.9.15 As one of our existing software vendors, can
you just fill in this questionnaire for us?
A.9.16 The sha1sums / sha256sums / etc files on your
download page don't match the binaries.
A.10 Miscellaneous questions
A.10.1 Is PuTTY a port of OpenSSH, or based on
OpenSSH or OpenSSL?
A.10.2 Where can I buy silly putty?
A.10.3 What does ‘PuTTY’ mean?
A.10.4 How do I pronounce ‘PuTTY’?
A.1 Introduction
A.1.1 What is PuTTY?
A.1.1 What is PuTTY?
PuTTY is a client program for the SSH, Telnet and Rlogin
network protocols.
try the changes page, and see if you can find the
feature on there. If a feature is listed there, it's been
implemented. If it's listed as a change made since the
latest version, it should be available in the development
snapshots, in which case testing will be very welcome.
try the Wishlist page, and see if you can find the feature
there. If it's on there, and not in the ‘Recently fixed’
section, it probably hasn't been implemented.
If you don't have Gtk, you should still be able to build the
command-line tools.
A.3.3 What's the point of the Unix
port? Unix has OpenSSH.
All sorts of little things. pterm is directly useful to anyone
who prefers PuTTY's terminal emulation to xterm's, which at
least some people do. Unix Plink has apparently found a
niche among people who find the complexity of OpenSSL
makes OpenSSH hard to install (and who don't mind Plink
not having as many features). Some users want to generate
a large number of SSH keys on Unix and then copy them all
into PuTTY, and the Unix PuTTYgen should allow them to
automate that conversion process.
In 2015, after porting the GTK front end to work with GTK
3, we began another attempt based on making small
changes to the GTK code and building it against the OS X
Quartz version of GTK 3. This doesn't seem to have the
window redrawing problem any more, so it's already got
further than the last effort, but it is still substantially
unfinished.
You can ask PuTTY to delete all this data; see question
A.8.2.
Text that comes from the server does not have this icon,
and we've arranged that the server should not be able to
fake it. (There's no control sequence the server can send
which will make PuTTY draw its own icon, and if the server
tries to move the cursor back up to a line that already has
an icon and overwrite the text, the icon will disappear.)
If you trust your server not to be abusive, you can turn this
off. It will also not appear in various other circumstances
where Plink can be confident it isn't necessary. See section
7.2.3.6 for details.
A.6 HOWTO questions
A.6.1 What login name / password should I use?
A.6.2 What commands can I type into my PuTTY
terminal window?
A.6.3 How can I make PuTTY start up maximised?
A.6.4 How can I create a Windows shortcut to start a
particular saved session directly?
A.6.5 How can I start an SSH session straight from the
command line?
A.6.6 How do I copy and paste between PuTTY and
other Windows applications?
A.6.7 How do I use all PuTTY's features (public keys,
proxying, cipher selection, etc.) in PSCP, PSFTP and
Plink?
A.6.8 How do I use PSCP.EXE? When I double-click it
gives me a command prompt window which then closes
instantly.
A.6.9 How do I use PSCP to copy a file whose name has
spaces in?
A.6.10 Should I run the 32-bit or the 64-bit version?
A.6.1 What login name / password
should I use?
This is not a question you should be asking us.
PuTTY does not process the commands you type into it. It's
only a communications tool. It makes a connection to
another computer; it passes the commands you type to that
other computer; and it passes the other computer's
responses back to you. Therefore, the precise range of
commands you can use will not depend on PuTTY, but on
what kind of computer you have connected to and what
software is running on it. The PuTTY team cannot help you
with that.
Not all features are accessible from the command line yet,
although we'd like to fix this. In the meantime, you can use
most of PuTTY's features if you create a PuTTY saved
session, and then use the name of the saved session on the
command line in place of a hostname. This works for PSCP,
PSFTP and Plink (but don't expect port forwarding in the file
transfer applications!).
A.6.8 How do I use PSCP.EXE? When I
double-click it gives me a command
prompt window which then closes
instantly.
PSCP is a command-line application, not a GUI application.
If you run it without arguments, it will simply print a help
message and terminate.
Set the key's value to something like 10. This will cause
Windows to try harder to keep connections alive instead of
abandoning them.
A.7.10 When I cat a binary file, I get
‘PuTTYPuTTYPuTTY’ on my command
line.
Don't do that, then.
With release 8.0, Red Hat appear to have made UTF-8 the
default character set. There appears to be no way for
terminal emulators such as PuTTY to know this (as far as we
know, the appropriate escape sequence to switch into UTF-8
mode isn't sent).
(However, we've been told that SP2 also fixes the bug that
means you need to use non-127.0.0.1 addresses to forward
Terminal Services in the first place.)
A.7.18 PSFTP commands seem to be
missing a directory separator (slash).
Some people have reported the following incorrect
behaviour with PSFTP:
psftp> pwd
Remote directory is /dir1/dir2
psftp> get filename.ext
/dir1/dir2filename.ext: no such file or directory
These delays are inconvenient, but they are there for your
protection. If they really cause you a problem, you can
choose to turn off periodic rekeying using the ‘Kex’
configuration panel (see section 4.20), but be aware that
you will be sacrificing security for this. (Falling back to SSH-
1 would also remove the delays, but would lose a lot more
security still. We do not recommend it.)
A.7.21 PuTTY fails to start up.
Windows claims that ‘the application
configuration is incorrect’.
This is caused by a bug in certain versions of Windows XP
which is triggered by PuTTY 0.58. This was fixed in 0.59.
The ‘xp-wont-run’ entry in PuTTY's wishlist has more
details.
A.7.22 When I put 32-bit PuTTY in
C:\WINDOWS\SYSTEM32 on my 64-bit
Windows system, ‘Duplicate Session’
doesn't work.
The short answer is not to put the PuTTY executables in that
location.
If you think you have such a server, from 0.69 onwards you
can disable sending of the IUTF8 mode: on the SSH / TTY
panel, select IUTF8 on the list, select ‘Nothing’, and press
‘Set’. (It's not possible to disable sending this mode in
0.68.)
A.8 Security questions
A.8.1 Is it safe for me to download PuTTY and use it on
a public PC?
A.8.2 What does PuTTY leave on a system? How can I
clean up after it?
A.8.3 How come PuTTY now supports DSA, when the
website used to say how insecure it was?
A.8.4 Couldn't Pageant use VirtualLock() to stop private
keys being written to disk?
A.8.1 Is it safe for me to download
PuTTY and use it on a public PC?
It depends on whether you trust that PC. If you don't trust
the public PC, don't use PuTTY on it, and don't use any
other software you plan to type passwords into either. It
might be watching your keystrokes, or it might tamper with
the PuTTY binary you download. There is no program safe
enough that you can run it on an actively malicious PC and
get away with typing passwords into it.
Mail us and vote for it. (Be sure to mention that you've
seen it on the Wishlist, or we might think you haven't
even read the Wishlist). This probably won't have very
much effect; if a huge number of people vote for
something then it may make a difference, but one or
two extra votes for a particular feature are unlikely to
change our priority list immediately. Offering a new and
compelling justification might help. Also, don't expect a
reply.
Offer us money if we do the work sooner rather than
later. This sometimes works, but not always. The PuTTY
team all have full-time jobs and we're doing all of this
work in our free time; we may sometimes be willing to
give up some more of our free time in exchange for
some money, but if you try to bribe us for a big feature
it's entirely possible that we simply won't have the time
to spare - whether you pay us or not. (Also, we don't
accept bribes to add bad features to the Wishlist,
because our desire to provide high-quality software to
the users comes first.)
Offer to help us write the code. This is probably the only
way to get a feature implemented quickly, if it's a big
one that we don't have time to do ourselves.
B.6 Support requests
If you're trying to make PuTTY do something for you and it
isn't working, but you're not sure whether it's a bug or not,
then please consider looking for help somewhere else. This
is one of the most common types of mail the PuTTY team
receives, and we simply don't have time to answer all the
questions. Questions of this type include:
If you just want to link to our web site, just go ahead. (It's
not clear that we could stop you doing this, even if we
wanted to!)
B.9 Mirroring the PuTTY web site
If you want to set up a mirror of the PuTTY website, go
ahead and set one up. Please don't bother asking us for
permission before setting up a mirror. You already have
permission.
Also note that we link to all our mirror sites using the
rel="nofollow" attribute. Running a PuTTY mirror is not
intended to be a cheap way to gain search rankings.
The exceptions to that rule are due to the need for Visual
Studio compatibility:
Also, the front ends (in particular Windows Plink) can use
multiple threads if they like. However, Windows Plink keeps
very tight control of its auxiliary threads, and uses them
pretty much exclusively as a form of select(). Pretty much
all the code outside windows/winplink.c is only ever called
from the one primary thread; the others just loop round
blocking on file handles and send messages to the main
thread when some real work needs doing. This is not
considered a portability hazard because that bit of
windows/winplink.c will need rewriting on other platforms in
any case.
See
https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
for a more in-depth discussion of what these macros are for
and how they work.
Snapshot Key
Used to sign routine development builds of PuTTY:
nightly snapshots, pre-releases, and sometimes also
custom diagnostic builds we send to particular users.
Release Key
Used to sign manually released versions of PuTTY.
Secure Contact Key
An encryption-capable key suitable for people to send
confidential messages to the PuTTY team, e.g. reports
of vulnerabilities.
Master Key
Used to tie all the above keys into the GPG web of trust.
The Master Key signs all the other keys, and other GPG
users have signed it in turn.
The Master Key is especially long, and its private key and
passphrase are stored with special care.
Each new Master Key is signed with the old one, to show
that it really is owned by the same people and not
substituted by an attacker.
Each new Master Key also signs the previous Release Keys,
in case you're trying to verify the signatures on a release
prior to the rollover and can find a chain of trust to those
keys from any of the people who have signed our new
Master Key.