Puttydoc
Puttydoc
=================
PuTTY is a free (MIT-licensed) Windows Telnet and SSH client. This manual
documents PuTTY, and its companion utilities PSCP, PSFTP, Plink, Pageant
and PuTTYgen.
_Note to Unix users:_ this manual currently primarily documents the Windows
versions of the PuTTY utilities. Some options are therefore mentioned
that are absent from the Unix version; the Unix version has features
not described here; and the pterm and command-line puttygen and pageant
utilities are not described at all. The only Unix-specific documentation
that currently exists is the man pages.
This manual is copyright 1997-2023 Simon Tatham. All rights reserved. You
may distribute this documentation under the MIT licence. See appendix D for
the licence text in full.
PuTTY is a free SSH, Telnet, Rlogin, and SUPDUP client for Windows
systems.
If you already know what SSH, Telnet, Rlogin, and SUPDUP are, you
can safely skip on to the next section.
SSH, Telnet, Rlogin, and SUPDUP are four ways of doing the same
thing: logging in to a multi-user computer from another computer,
over a network.
SSH, Telnet, Rlogin, and SUPDUP 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.
- you want to use a bulletin board system, talker or MUD which can
be accessed using Telnet.
You probably do _not_ want to use SSH, Telnet, Rlogin, or SUPDUP if:
- you only use Windows. Windows computers have their own ways
of networking between themselves, and unless you are doing
something fairly unusual, you will not need to use any of these
remote login protocols.
- SSH and Rlogin both allow you to log in to the server without
having to type a password. (Rlogin's method of doing this is
insecure, and can allow an attacker to access your account on
the server. SSH's method is much more secure, and typically
breaking the security requires the attacker to have gained
access to your actual client machine.)
If your client and server are both behind the same (good) firewall,
it is more likely to be safe to use Telnet, Rlogin, or SUPDUP, but
we still recommend you use SSH.
When you start PuTTY, you will see a dialog box. This dialog box
allows you to control everything PuTTY can do. See chapter 4 for
details of all the things you can control.
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.
When you change the selected protocol, the number in the `Port'
box will change. This is normal: it happens because the various
login services are usually provided on different network ports
by the server machine. Most servers will use the standard port
numbers, so you will not need to change the port setting. If your
server provides login services on a non-standard port, your system
administrator should have told you which one. (For example, many
MUDs run Telnet service on a port other than 23.)
Once you have filled in the `Host Name', `Connection type', and
possibly `Port' settings, you are ready to connect. Press the `Open'
button at the bottom of the dialog box, and PuTTY will begin trying
to connect you to the server.
If you are not using the SSH protocol, you can skip this section.
If you are using SSH to connect to a server for the first time, you
will probably see a message looking something like this:
PuTTY records the host key for each server you connect to, in the
Windows Registry. Every time you connect to a server, it checks that
the host key presented by the server is the same host key as it was
the last time you connected. If it is not, you will see a stronger
warning, and you will have the chance to abandon your connection
before you type any private information (such as a password) into
it. (See section 10.2 for what that looks like.)
Whether or not to trust the host key is your choice. If you are
connecting within a company network, you might feel that all
the network users are on the same side and spoofing attacks are
unlikely, so you might choose to trust the key without checking
it. If you are connecting across a hostile network (such as the
Internet), you should check with your system administrator, perhaps
by telephone or in person. (When verifying the fingerprint, be
careful with letters and numbers that can be confused with each
other: `0'/`O', `1'/`I'/`l', and so on.)
Many servers have more than one host key. If the system
administrator sends you more than one fingerprint, you should make
sure the one PuTTY shows you is on the list, but it doesn't matter
which one it is.
If you don't have any fingerprints that look like the example
(`SHA256:' followed by a long string of characters), but instead
have pairs of characters separated by colons like `a4:db:96:a7:...',
try pressing the `More info...' button and see if you have a
fingerprint matching the `MD5 fingerprint' there. This is an older
and less secure way to summarise the same underlying host key; it's
possible for an attacker to create their own host key with the same
fingerprint; so you should avoid relying on this fingerprint format
unless you have no choice. The `More info...' dialog box also shows
the full host public key, in case that is easier to compare than a
fingerprint.
See section 4.19 for advanced options for managing host keys.
2.3 Logging in
After you have connected, and perhaps verified the server's host
key, you will be asked to log in, probably using a username and a
password. Your system administrator should have provided you with
these. (If, instead, your system administrator has asked you to
provide, or provided you with, a `public key' or `key file', see
chapter 8.)
PuTTY will display a text window (the `terminal window' - it will
have a black background unless you've changed the defaults), and
prompt you to type your username and password into that window.
(These prompts will include the PuTTY icon, to distinguish them from
any text sent by the server in the same window.)
Enter the username and the password, and the server should grant you
access and begin your session. If you have mistyped your password,
most servers will give you several chances to get it right.
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.)
If you are using SSH, be careful not to type your username wrongly,
because you will not have a chance to correct it after you press
Return; many SSH servers do not permit you to make two login
attempts using different usernames. If you type your username
wrongly, you must close PuTTY and start again.
If your password is refused but you are sure you have typed it
correctly, check that Caps Lock is not enabled. Many login servers,
particularly Unix computers, treat upper case and lower case as
different when checking your password; so if Caps Lock is on, your
password will probably be refused.
When you have finished your session, you should log out by typing
the server's own logout command. This might vary between servers; if
in doubt, try `logout' or `exit', or consult a manual or your system
administrator. When the server processes your logout command, the
PuTTY window should close itself automatically.
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.
Often in a PuTTY session you will find text on your terminal screen
which you want to type in again. Like most other terminal emulators,
PuTTY allows you to copy and paste the text rather than having to
type it again. Also, copy and paste uses the Windows clipboard, so
that you can paste (for example) URLs into a web browser, or paste
from a word processor or spreadsheet into your terminal session.
By default, PuTTY's copy and paste works entirely with the mouse.
(This will be familiar to people who have used `xterm' on Unix.) In
order to copy text to the clipboard, you just click the left mouse
button in the terminal window, and drag to select text. When you
let go of the button, the text is _automatically_ copied to the
clipboard. You do not need to press Ctrl-C or Ctrl-Ins; in fact, if
you do press Ctrl-C, PuTTY will send a Ctrl-C character down your
session to the server where it will probably cause a process to be
interrupted.
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.)
If you double-click the left mouse button, PuTTY will select a whole
word. If you double-click, hold down the second click, and drag the
mouse, PuTTY will select a sequence of whole words. (You can adjust
precisely what PuTTY considers to be part of a word; see section
4.12.1.) If you _triple_-click, or triple-click and drag, then PuTTY
will select a whole line or sequence of lines.
If you have a middle mouse button, then you can use it to adjust an
existing selection if you selected something slightly wrong. (If you
have configured the middle mouse button to paste, then the right
mouse button does this instead.) Click the button on the screen,
and you can pick up the nearest end of the selection and drag it to
somewhere else.
It's possible for the server to ask to handle mouse clicks in the
PuTTY window itself. If this happens, the mouse pointer will turn
into an arrow, and using the mouse to copy and paste will only work
if you hold down Shift. See section 4.6.2 and section 4.11.2 for
details of this feature and how to configure it.
PuTTY keeps track of text that has scrolled up off the top of the
terminal. So if something appears on the screen that you want to
read, but it scrolls too fast and it's gone by the time you try to
look for it, you can use the scrollbar on the right side of the
window to look back up the session history and find it again.
As well as using the scrollbar, you can also page the scrollback up
and down by pressing Shift-PgUp and Shift-PgDn. You can scroll a
line at a time using Ctrl-PgUp and Ctrl-PgDn, or to the top/bottom
of the scrollback with Ctrl-Shift-PgUp and Ctrl-Shift-PgDn. These
are still available if you configure the scrollbar to be invisible.
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.
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.)
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.
The `break' signal can also be invoked from the keyboard with Ctrl-
Break.
- IGNORE message
- Break
- Synch
- Erase Character
PuTTY can also be configured to send this when the Backspace key
is pressed; see section 4.30.3.
- Erase Line
- Go Ahead
- No Operation
- Abort Process
- Abort Output
- Interrupt Process
- Suspend Process
- End Of Record
- End Of File
- The `Saved Sessions' submenu gives you quick access to any sets
of stored session details you have previously saved. See section
4.1.2 for details of how to create saved sessions.
If you select `Change Settings' from the system menu, PuTTY will
display a cut-down version of its initial configuration box. This
allows you to adjust most properties of your current session. You
can change the terminal size, the font, the actions of various
keypresses, the colours, and so on.
Some of the options that are available in the main configuration box
are not shown in the cut-down Change Settings box. These are usually
options which don't make sense to change in the middle of a session
(for example, you can't switch from SSH to Telnet in mid-session).
You can save the current settings to a saved session for future use
from this dialog box. See section 4.1.2 for more on saved sessions.
This system menu option provides a convenient way to copy the whole
contents of the terminal screen (up to the last nonempty line) and
scrollback to the clipboard in one go.
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.
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.
The SSH protocol has the ability to securely forward X Window System
graphical applications over your encrypted SSH connection, so that
you can run an application on the SSH server machine and have it put
its windows up on your local machine without sending any X network
traffic in the clear.
You should then tick the `Enable X11 forwarding' box in the X11
panel (see section 4.25) 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 click the `Add' button. The details of your port forwarding
should appear in the list box.
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:
You can also forward ports in the other direction: arrange for a
particular port number on the _server_ machine to be forwarded back
to your PC as a connection to a service on your PC or near it. To do
this, just select the `Remote' radio button instead of the `Local'
one. The `Source port' box will now specify a port number on the
_server_ (note that most servers will not allow you to use port
numbers under 1024 for this purpose).
The source port for a forwarded connection usually does not accept
connections from any machine except the SSH client or server machine
itself (for local and remote forwardings respectively). There are
controls in the Tunnels panel to change this:
- The `Remote ports do the same' option does the same thing for
remote-to-local port forwardings (so that machines other than
the SSH server machine can connect to the forwarded port.) Note
that this feature is only available in the SSH-2 protocol, and
not all SSH-2 servers honour it (in OpenSSH, for example, it's
usually disabled by default).
(Note that if you're using Windows XP Service Pack 2, you may need
to obtain a fix from Microsoft in order to use addresses like
127.0.0.5 - see question A.7.17.)
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.
A serial line provides no well defined means for one end of the
connection to notify the other that the connection is finished.
Therefore, PuTTY in serial mode will remain connected until you
close the window using the close button.
Telnet was perhaps the most popular remote login protocol before SSH
was introduced. It was general enough to be used by multiple server
operating systems (Unix and VMS in particular), and supported many
optional protocol extensions providing extra support for particular
server features.
SUPDUP provides no well defined means for one end of the connection
to notify the other that the connection is finished. Therefore,
PuTTY in SUPDUP mode will remain connected until you close the
window using the close button.
If this syntax is used, settings are taken from the Default Settings
(see section 4.1.2); `user' overrides these settings if supplied.
Also, you can specify a protocol, which will override the default
protocol (see section 3.11.3.2).
putty.exe telnet://host[:port]/
3.11.2 `-cleanup'
To choose which protocol you want to connect with, you can use one
of these options:
Most of these options are not available in the file transfer tools
PSCP and PSFTP (which only work with the SSH protocol and the bare
ssh-connection protocol).
You can specify the user name to log in as on the remote server
using the `-l' option. For example, `plink login.example.com -
l fred'.
These options are not available in the file transfer tools PSCP and
PSFTP.
With some servers (particularly Unix systems), you can even put
multiple lines in this file and execute more than one command in
sequence, or a whole shell script; but this is arguably an abuse,
and cannot be expected to work on all servers. In particular, it is
known _not_ to work with certain `embedded' servers, such as Cisco
routers.
This option is not available in the file transfer tools PSCP and
PSFTP.
The `-P' option is used to specify the port number to connect to. If
you have a Telnet server running on port 9696 of a machine instead
of port 23, for example:
Note that these options only work when you are using the SSH
protocol. Due to fundamental limitations of Telnet, Rlogin,
and SUPDUP, these protocols do not support automated password
authentication.
The `-A' option turns on SSH agent forwarding, and `-a' turns it
off. These options are only meaningful if you are using SSH.
See chapter 9 for general information on Pageant, and section 9.4
for information on agent forwarding. Note that there is a security
risk involved with enabling this option; see section 9.6 for
details.
These options are not available in the file transfer tools PSCP and
PSFTP.
The `-X' option turns on X11 forwarding in SSH, and `-x' turns it
off. These options are only meaningful if you are using SSH.
These options are not available in the file transfer tools PSCP and
PSFTP.
These options are not available in the file transfer tools PSCP and
PSFTP.
This option is not available in the file transfer tools PSCP and
PSFTP.
The `-nc' option prevents Plink (or PuTTY) from attempting to start
a shell or command on the remote server. Instead, it will instruct
the remote server to open a network connection to a host name and
port number specified by you, and treat that network connection as
if it were the main session.
You specify a host and port as an argument to the `-nc' option, with
a colon separating the host name from the port number, like this:
However, this does depend on the program _using_ the proxy being
able to run a subprocess in place of making a network connection.
PuTTY itself can do this using the `Local' proxy type, but there's a
built-in more flexible way using the `SSH' proxy type. (See section
4.16.1 for a description of both.) So this feature is probably most
useful with another client program as the end user.
(The option is named `-nc' after the Unix program `nc', short for
`netcat'. The command `plink host1 -nc host2:port' is very similar
in functionality to `plink host1 nc host2 port', which invokes `nc'
on the server and tells it to connect to the specified destination.
However, Plink's built-in `-nc' option does not depend on the `nc'
program being installed on the server.)
The `-C' option enables compression of the data sent across the
network. This option is only meaningful if you are using SSH.
The `-1' and `-2' options force PuTTY to use version 1 or version 2
of the SSH protocol. These options are only meaningful if you are
using SSH.
The `-4' and `-6' options force PuTTY to use the older Internet
protocol IPv4 or the newer IPv6 for most outgoing connections.
The `-i' option allows you to specify the name of a private key file
in `*.PPK' format which PuTTY will use to authenticate with the
server. This option is 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.)
This option overrides PuTTY's normal SSH host key caching policy by
telling it the name of the host you expect your connection to end up
at (in cases where this differs from the location PuTTY thinks it's
connecting to). It can be a plain host name, or a host name followed
by a colon and a port number. See section 4.14.5 for more detail on
this.
This option overrides PuTTY's normal SSH host key caching policy
by telling it exactly what host key to expect, which can be
useful if the normal automatic host key store in the Registry is
unavailable. The argument to this option should be either a host key
fingerprint, or an SSH-2 public key blob. See section 4.19.3 for
more information.
You can specify this option more than once if you want to configure
more than one key to be accepted.
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 F for more
information.
These options cause the PuTTY network tools to write out a log
file. Each of them expects a file name as an argument, e.g. `-
sshlog putty.log' causes an SSH packet log to be written to a file
called `putty.log'. The three different options select different
logging modes, all available from the GUI too:
This option enables PuTTY's mode for running a command on the local
machine and using it as a proxy for the network connection. It
expects a shell command string as an argument.
See section 4.16.1 for more information on this, and on other proxy
settings. In particular, note that since the special sequences
described there are understood in the argument string, literal
backslashes must be doubled (if you want `\' in your command, you
must put `\\' on the command line).
This option (on Windows only) causes PuTTY (or another PuTTY tool)
to try to lock down the operating system's access control on its own
process. If this succeeds, it should present an extra obstacle to
malware that has managed to run under the same user id as the PuTTY
process, by preventing it from attaching to PuTTY using the same
interfaces debuggers use and either reading sensitive information
out of its memory or hijacking its network session.
If you start PuTTY with the `-host-ca' option, it will not launch
a session at all. Instead, it will just display the configuration
dialog box for host certification authorities, as described in
section 4.19.4. When you dismiss that dialog box, PuTTY will
terminate.
Chapter 4: Configuring PuTTY
----------------------------
PuTTY is configured using the control panel that comes up before you
start a session. Some options can also be changed in the middle of a
session, by selecting `Change Settings' from the window menu.
The Session configuration panel contains the basic options you need
to specify in order to open a session at all, and also allows you to
save your settings to be reloaded later.
The top box on the Session panel, labelled `Specify the destination
you want to connect to', contains the details that need to be filled
in before PuTTY can open a session at all.
- The `Host Name' box is where you type the name, or the IP
address, of the server you want to connect to.
- The `Port' box lets you specify which port number on the server
to connect to. If you select Telnet, Rlogin, SUPDUP, or SSH,
this box will be filled in automatically to the usual value, and
you will only need to change it if you have an unusual server.
If you select Raw mode, you will almost certainly need to fill
in the `Port' box yourself.
The next part of the Session configuration panel allows you to save
your preferred PuTTY options so they will appear automatically the
next time you start PuTTY. It also allows you to create _saved
sessions_, which contain a full set of configuration options plus a
host name and protocol. A saved session contains all the information
PuTTY needs to start exactly the session you want.
- To save your default settings: first set up the settings the way
you want them saved. Then come back to the Session panel. Select
the `Default Settings' entry in the saved sessions list, with a
single click. Then press the `Save' button.
To save the new settings under a different name, you can enter
the new name in the `Saved Sessions' box, or single-click to
select a session name in the list box to overwrite that session.
To save `Default Settings', you must single-click the name
before saving.
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions
If you need to store them in a file, you could try the method
described in section 4.33.
The Logging configuration panel allows you to save log files of your
PuTTY sessions, for debugging, analysis or future reference.
- `None'. This is the default option; in this mode PuTTY will not
create a log file at all.
Note that the non-SSH logging options (`Printable output' and `All
session output') only work with PuTTY proper; in programs without
terminal emulation (such as Plink), they will have no effect, even
if enabled via saved settings.
In this edit box you enter the name of the file you want to log the
session to. The `Browse' button will let you look around your file
system to find the right place to put the file; or if you already
know exactly where you want it to go, you can just type a pathname
into the edit box.
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:
- `&H' will be replaced by the host name you are connecting to (or
the serial line, for a serial connection).
log-server1.example.com-20010528-110859.dat
log-unixbox.somewhere.org-20010611-221001.dat
When checked, decrypted password fields are removed from the log of
transmitted packets. (This includes any user responses to challenge-
response authentication methods such as `keyboard-interactive'.)
This does not include X11 authentication data if using X11
forwarding.
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.
Auto wrap mode controls what happens when text printed in a PuTTY
window reaches the right-hand edge of the window.
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.
Auto wrap mode can be turned on and off by control sequences sent by
the server. This configuration option controls the _default_ state,
which will be restored when you reset the terminal (see section
3.1.3.6). However, if you modify this option in mid-session using
`Change Settings', it will take effect immediately.
The server can send a control sequence that restricts the scrolling
region of the display. For example, in an editor, the server might
reserve a line at the top of the screen and a line at the bottom,
and might send a control sequence that causes scrolling operations
to affect only the remaining lines.
With DEC Origin Mode on, cursor coordinates are counted from the top
of the scrolling region. With it turned off, cursor coordinates are
counted from the top of the whole screen regardless of the scrolling
region.
It is unlikely you would need to change this option, but if you find
a full-screen application is displaying pieces of text in what looks
like the wrong part of the screen, you could try turning DEC Origin
Mode on to see whether that helps.
DEC Origin Mode can be turned on and off by control sequences sent
by the server. This configuration option controls the _default_
state, which will be restored when you reset the terminal (see
section 3.1.3.6). However, if you modify this option in mid-session
using `Change Settings', it will take effect immediately.
Most servers send two control characters, CR and LF, to start a new
line of the screen. The CR character makes the cursor return to the
left-hand side of the screen. The LF character makes the cursor move
one line down (and might make the screen scroll).
Some servers only send LF, and expect the terminal to move the
cursor over to the left automatically. If you come across a server
that does this, you will see a stepped effect on the screen, like
this:
First line of text
Second line
Third line
Most servers send two control characters, CR and LF, to start a new
line of the screen. The CR character makes the cursor return to the
left-hand side of the screen. The LF character makes the cursor move
one line down (and might make the screen scroll).
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.
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.
The server can ask PuTTY to display text that blinks on and off.
This is very distracting, so PuTTY allows you to turn blinking text
off completely.
This option controls what PuTTY will send back to the server if the
server sends it the ^E enquiry character. Normally it just sends the
string `PuTTY'.
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.
With local echo disabled, characters you type into the PuTTY window
are not echoed in the window _by PuTTY_. They are simply sent to the
server. (The _server_ might choose to echo them back to you; this
can't be controlled from the PuTTY control panel.)
Some types of session need local echo, and many do not. In its
default mode, PuTTY will automatically attempt to deduce whether
or not local echo is appropriate for the session you are working
in. If you find it has made the wrong decision, you can use this
configuration option to override its choice: you can force local
echo to be turned on, or force it to be turned off, instead of
relying on the automatic detection.
Normally, every character you type into the PuTTY window is sent
immediately to the server the moment you type it.
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.
Some types of session need local line editing, and many do not. In
its default mode, PuTTY will automatically attempt to deduce whether
or not local line editing is appropriate for the session you are
working in. If you find it has made the wrong decision, you can use
this configuration option to override its choice: you can force
local line editing to be turned on, or force it to be turned off,
instead of relying on the automatic detection.
When the remote server attempts to print some data, PuTTY will send
that data to the printer _raw_ - without translating it, attempting
to format it, or doing anything else to it. It is up to you to
ensure your remote server knows what type of printer it is talking
to.
Since PuTTY sends data to the printer raw, it cannot offer options
such as portrait versus landscape, print quality, or paper tray
selection. All these things would be done by your PC printer driver
(which PuTTY bypasses); if you need them done, you will have to find
a way to configure your remote server to do them.
Some terminals believe that the Backspace key should send the same
thing to the server as Control-H (ASCII code 8). Other terminals
believe that the Backspace key should send ASCII code 127 (usually
known as Control-?) so that it can be distinguished from Control-H.
This option allows you to choose which code PuTTY generates when you
press Backspace.
If you are connecting over SSH, PuTTY by default tells the server
the value of this option (see section 4.24.2), so you may find that
the Backspace key does the right thing either way. Similarly, if
you are connecting to a Unix system, you will probably find that
the Unix `stty' command lets you configure which the server expects
to see, so again you might not need to change which one PuTTY
generates. On other systems, the server's expectation might be fixed
and you might have no choice but to configure PuTTY.
The Unix terminal emulator `rxvt' disagrees with the rest of the
world about what character sequences should be sent to the server by
the Home and End keys.
`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.
If you find an application on which the Home and End keys aren't
working, you could try switching this option to see if it helps.
This option affects the function keys (F1 to F12) and the top row of
the numeric keypad.
- In Linux mode, F6 to F12 behave just like the default mode, but
F1 to F5 generate `ESC [[A' through to `ESC [[E'. This mimics
the Linux virtual console.
- In VT400 mode, all the function keys behave like the default
mode, but the actual top row of the numeric keypad generates
`ESC OP' through to `ESC OS'.
- In Xterm 216 mode, the unshifted function keys behave the same
as Xterm R6 mode. But pressing a function key together with
Shift or Alt or Ctrl generates a different sequence containing
an extra numeric parameter of the form (1 for Shift) + (2 for
Alt) + (4 for Ctrl) + 1. For F1-F4, the basic sequences like
`ESC OP' become ESC [1;_bitmap_P and similar; for F5 and above,
ESC[_index_~ becomes ESC[_index_;_bitmap_~.
If you don't know what any of this means, you probably don't need to
fiddle with it.
This option affects the arrow keys, if you press one with any of the
modifier keys Shift, Ctrl or Alt held down.
If you don't know what any of this means, you probably don't need to
fiddle with it.
Application Cursor Keys mode is a way for the server to change the
control sequences sent by the arrow keys. In normal mode, the arrow
keys send `ESC [A' through to `ESC [D'. In application mode, they
send `ESC OA' through to `ESC OD'.
Application Cursor Keys mode can be turned on and off by the server,
depending on the application. PuTTY allows you to configure the
initial state.
You can also disable application cursor keys mode completely, using
the `Features' configuration panel; see section 4.6.1.
Depending on which version of Windows you run, you may find the Num
Lock light still flashes on and off every time you press Num Lock,
even when application mode is active and Num Lock is acting like a
function key. This is unavoidable.
You can also disable application keypad mode completely, using the
`Features' configuration panel; see section 4.6.1.
PuTTY has a special mode for playing NetHack. You can enable it
by selecting `NetHack' in the `Initial state of numeric keypad'
control.
In this mode, the numeric keypad keys 1-9 generate the NetHack
movement commands (hjklyubn). The 5 key generates the `.' command
(do nothing).
For some reason, this feature only works properly when Num Lock is
on. We don't know why.
Some old keyboards do not have an AltGr key, which can make it
difficult to type some characters. PuTTY can be configured to treat
the key combination Ctrl + Left Alt the same way as the AltGr key.
If you uncheck this box, Ctrl-Alt will become a synonym for AltGr,
so you can use it to type extra graphic characters if your keyboard
has any.
The Bell panel controls the terminal bell feature: the server's
ability to cause PuTTY to beep at you.
If you select `Steady', then when a bell occurs and the window is
not in focus, the window's Taskbar entry and its title bar will
change colour to let you know that PuTTY session is asking for your
attention. The change of colour will persist until you select the
window, so you can leave several PuTTY windows minimised in your
terminal, go away from your keyboard, and be sure not to have missed
any important beeps when you get back.
If you want this feature completely disabled, you can turn it off
using the checkbox `Bell is temporarily disabled when over-used'.
PuTTY allows the server to send control codes that let it take
over the mouse and use it for purposes other than copy and paste.
Applications which use this feature include the text-mode web
browser `links', the Usenet newsreader `trn' version 4, and the file
manager `mc' (Midnight Commander).
If you find this feature inconvenient, you can disable it using the
`Disable xterm-style mouse reporting' control. With this box ticked,
the mouse will _always_ do copy and paste in the normal way.
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).
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.
Some people prefer this not to happen. If you want your editor to
run in the same screen as the rest of your terminal activity, you
can disable the alternate screen feature completely.
`None'
`Empty string'
`Window title'
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.
If you find that accented characters are not showing up the way you
expect them to, particularly if you're running BitchX, you could try
disabling the remote character set configuration commands.
You may also find you need to disable bidirectional text display;
see section 4.6.11.
You may also find you need to disable Arabic text shaping; see
section 4.6.10.
The `Columns' and `Rows' boxes let you set the PuTTY window to a
precise size. Of course you can also drag the window to a new size
while a session is running.
These options allow you to control what happens when the user tries
to resize the PuTTY window using its window furniture.
- `Change the number of rows and columns': the font size will not
change. (This is the default.)
- `Change the size of the font': the number of rows and columns in
the terminal will stay the same, and the font size will change.
These options let you configure the way PuTTY keeps text after it
scrolls off the top of the screen (see section 3.1.2).
The `Lines of scrollback' box lets you configure how many lines of
text PuTTY keeps. The `Display scrollbar' options allow you to hide
the scrollbar (although you can still view the scrollback using
the keyboard as described in section 3.1.2). You can separately
configure whether the scrollbar is shown in full-screen mode and in
normal modes.
If you are viewing part of the scrollback when the server sends
more text to PuTTY, the screen will revert to showing the current
terminal contents. You can disable this behaviour by turning off
`Reset scrollback on display activity'. You can also make the screen
revert when you press a key, by turning on `Reset scrollback on
keypress'.
The `Cursor blinks' option makes the cursor blink on and off. This
works in any of the cursor modes.
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 enable this option, the mouse pointer will disappear if the
PuTTY window is selected and you press a key. This way, it will
not obscure any of the text in the window while you work in your
session. As soon as you move the mouse, the pointer will reappear.
You can also configure a completely blank gap between the text in
the window and the border, using the `Gap between text and window
edge' control. By default this is set at one pixel. You can reduce
it to zero, or increase it further.
The `Window title' edit box allows you to set the title of the PuTTY
window. By default the window title will contain the host name
followed by `PuTTY', for example `server1.example.com - PuTTY'. If
you want a different window title, this is where to set it.
If this option is enabled, the PuTTY window will stay on top of all
other windows.
The full-screen feature is also available from the System menu, even
when it is configured not to be available on the Alt-Enter key. See
section 3.1.3.7.
By default PuTTY will use the UTF-8 encoding of Unicode, which can
represent pretty much any character; data coming from the server
is interpreted as UTF-8, and keystrokes are sent UTF-8 encoded.
This is what most modern distributions of Linux will expect by
default. However, if this is wrong for your server, you can select a
different character set using this control.
- The ISO-8859 series are all standard character sets that include
various accented characters appropriate for different sets of
languages.
- If you want the old IBM PC character set with block graphics and
line-drawing characters, you can select `CP437'.
If you need support for a numeric code page which is not listed in
the drop-down list, such as code page 866, then you can try entering
its name manually (`CP866' for example) in the list box. If the
underlying version of Windows has the appropriate translation table
installed, PuTTY will use it.
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).
- `Use Unicode line drawing code points' tries to use the box
characters that are present in Unicode. For good Unicode-
supporting fonts this is probably the most reliable and
functional option.
- `Font has XWindows encoding' is for use with fonts that have a
special encoding, where the lowest 32 character positions (below
the ASCII printable range) contain the line-drawing characters.
This is unlikely to be the case with any standard Windows font;
it will probably only apply to custom-built fonts or fonts that
have been automatically converted from the X Window System.
- `Use font in both ANSI and OEM modes' tries to use the same font
in two different character sets, to obtain a wider range of
characters. This doesn't always work; some fonts claim to be a
different size depending on which character set you try to use.
- `Use font in OEM mode only' is more reliable than that, but can
miss out other characters from the main character set.
By default, when you copy and paste a piece of the PuTTY screen that
contains VT100 line and box drawing characters, PuTTY will paste
them in the form they appear on the screen: either Unicode line
drawing code points, or the `poor man's' line-drawing characters
`+', `-' and `|'. The checkbox `Copy and paste VT100 line drawing
chars as lqqqk' disables this feature, so line-drawing characters
will be pasted as the ASCII characters that were printed to produce
them. This will typically mean they come out mostly as `q' and `x',
with a scattering of `jklmntuvw' at the corners. This might be
useful if you were trying to recreate the same box layout in another
program, for example.
The rationale is that in UTF-8 mode you don't need those control
sequences anyway, because all the line-drawing characters they
access are available as Unicode characters already, so there's no
need for applications to put the terminal into a special state to
get at them.
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.
The Selection panel allows you to control the way copy and paste
work in the PuTTY window.
If you have a three-button mouse and you are already used to the
`xterm' arrangement, you can select it using the `Action of mouse
buttons' control.
If you want to prevent the application from taking over the mouse at
all, you can do this using the Features control panel; see section
4.6.2.
Normally, you have to hold down Alt while dragging the mouse to
select a rectangular block. Using the `Default selection mode'
control, you can set rectangular selection as the default, and then
you have to hold down Alt to get the _normal_ behaviour.
The two most commonly used selections are called `PRIMARY' and
`CLIPBOARD'; in applications supporting both, the usual behaviour
is that PRIMARY is used by mouse-only actions (selecting text
automatically copies it to PRIMARY, and middle-clicking pastes from
PRIMARY), whereas CLIPBOARD is used by explicit Copy and Paste menu
items or keypresses such as Ctrl-C and Ctrl-V.
The two keyboard options each come with a corresponding key to copy
_to_ the same clipboard. Whatever you configure Shift-Ins to paste
from, Ctrl-Ins will copy to the same location; similarly, Ctrl-
Shift-C will copy to whatever Ctrl-Shift-V pastes from.
So, for example, if you assign the `@' symbol into character class
2, you will be able to select an e-mail address with just a double
click.
If you do not see `colors#256' in the output, you may need to change
your terminal setting. On modern Linux machines, you could try
`xterm-256color'.
When the server sends a control sequence indicating that some text
should be displayed in bold, PuTTY can handle this in several ways.
It can either change the font for a bold version, or use the same
font in a brighter colour, or it can do both (brighten the colour
_and_ embolden the font). This control lets you choose which.
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.
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).
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.)
PuTTY allows you to set the cursor colour, the default foreground
and background, and the precise shades of all the ANSI configurable
colours (black, red, green, yellow, blue, magenta, cyan, and white).
You can also modify the precise shades used for the bold versions
of these colours; these are used to display bold text if you have
chosen to indicate that by colour (see section 4.13.4), and can also
be used if the server asks specifically to use them. (Note that
`Default Bold Background' is _not_ the background colour used for
bold text; it is only used if the server specifically asks for a
bold background.)
If you find your sessions are closing unexpectedly (most often with
`Connection reset by peer') after they have been idle for a while,
you might want to try using this option.
Some network routers and firewalls need to keep track of all
connections through them. Usually, these firewalls will assume a
connection is dead if no data is transferred in either direction
after a certain time interval. This can cause PuTTY sessions to be
unexpectedly closed by the firewall if no traffic is seen in the
session for some time.
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.18.2.)
Keepalives are only supported in Telnet and SSH; the Rlogin, SUPDUP,
and Raw protocols offer no way of implementing them. (For an
alternative, see section 4.14.3.)
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.27.14),
enabling keepalives will have no effect.
This option allows the user to select between the old and new
Internet protocols and addressing schemes (IPv4 and IPv6). The
selected protocol will be used for most outgoing network connections
(including connections to proxies); however, tunnels have their own
configuration, for which see section 4.26.2.
This allows you to tell PuTTY that the host it will really end up
connecting to is different from where it thinks it is making a
network connection.
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'.
The Data panel allows you to configure various pieces of data which
can be sent to the server to affect your connection at the far end.
All three of the SSH, Telnet, and Rlogin protocols allow you to
specify what user name you want to log in as, without having to type
it explicitly every time. (Some Telnet servers don't support this.)
The Telnet, Rlogin, and SSH protocols allow the client to specify
terminal speeds to the server.
This parameter does _not_ affect the actual speed of the connection,
which is always `as fast as possible'; it is just a hint that is
sometimes used by server software to modify its behaviour. For
instance, if a slow speed is indicated, the server may switch to a
less bandwidth-hungry display mode.
The Proxy panel allows you to configure PuTTY to use various types
of proxy in order to make its network connections. The settings in
this panel affect the primary network connection forming your PuTTY
session, and also any extra connections made as a result of SSH port
forwarding (see section 3.5).
Note that unlike some software (such as web browsers), PuTTY does
not attempt to automatically determine whether to use a proxy and
(if so) which one to use for a given destination. If you need to use
a proxy, it must always be explicitly configured.
You can also enable this mode on the command line; see section
3.11.3.27.
The `Exclude Hosts/IPs' box may contain more than one exclusion
range, separated by commas. Each range can be an IP address or a DNS
name, with a `*' character allowing wildcards. For example:
*.example.com
192.168.88.*
192.168.88.*,*.example.com
Connections to the local host (the host name `localhost', and any
loopback IP address) are never proxied, even if the proxy exclude
list does not explicitly contain them. It is very unlikely that this
behaviour would ever cause problems, but if it does you can change
it by enabling `Consider proxying local host connections'.
Note that if you are doing DNS at the proxy (see section 4.16.3),
you should make sure that your proxy exclusion settings 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.
The `Do DNS name lookup at proxy end' configuration option allows
you to control this. If you set it to `No', PuTTY will always do its
own DNS, and will always pass an IP address to the proxy. If you set
it to `Yes', PuTTY will always pass host names straight to the proxy
without trying to look them up first.
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.
The original SOCKS 4 protocol does not support proxy-side DNS. There
is a protocol extension (SOCKS 4A) which does support it, but not
all SOCKS 4 servers provide this extension. If you enable proxy DNS
and your SOCKS 4 server cannot deal with it, this might be why.
If you want to avoid PuTTY making _any_ DNS query related to your
destination host name (for example, because your local DNS resolver
is very slow to return a negative response in that situation), then
as well as setting this control to `Yes', you may also need to
turn off GSSAPI authentication and GSSAPI key exchange in SSH (see
section 4.23 and section 4.18.1.1 respectively). This is because
GSSAPI setup also involves a DNS query for the destination host
name, and that query is performed by the separate GSSAPI library, so
PuTTY can't override or reconfigure it.
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.
- SOCKS 4 can use the `Username' field, but does not support
passwords.
- SSH proxying can use all the same forms of SSH authentication
supported by PuTTY for its main connection. If the SSH server
requests password authentication, any configured proxy password
will be used, but other authentication methods such as public
keys and GSSAPI will be tried first, just as for a primary
SSH connection, and if they require credentials such as a key
passphrase, PuTTY will interactively prompt for these.
If you are using the Telnet proxy type, the usual command required
by the firewall's Telnet server is `connect', followed by a host
name and a port number. If your proxy needs a different command, you
can enter an alternative in the `Command to send to proxy' box.
If you are using the Local proxy type, the local command to run is
specified here.
If you are using the `SSH to proxy and execute a command' type,
the command to run on the SSH proxy server is specified here.
Similarly, if you are using `SSH to proxy and invoke a subsystem',
the subsystem name is constructed as 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 anything specified in `Username' and
`Password' configuration fields will be ignored.
Often the proxy interaction has its own diagnostic output; this is
particularly the case for local proxy commands.
By default (`No'), proxy diagnostics are only sent to the Event Log;
with `Yes' they are also printed to the terminal, where they may
get mixed up with your main session. `Only until session starts' is
a compromise; proxy messages will go to the terminal window until
the main session is deemed to have started (in a protocol-dependent
way), which is when they're most likely to be interesting; any
further proxy-related messages during the session will only go to
the Event Log.
The SSH panel allows you to configure options that only apply to SSH
sessions.
In SSH, you don't have to run a general shell session on the server.
Instead, you can choose to run a single specific command (such as
a mail user agent, for example). If you want to do this, enter the
command in the `Remote command' box.
Note that most servers will close the session after executing the
command.
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.
This feature can also be enabled using the `-N' command-line option;
see section 3.11.3.13.
If you use this feature in Plink, you will not be able to terminate
the Plink process by any graceful means; the only way to kill it
will be by pressing Control-C or sending a kill signal from another
program.
PuTTY will not automatically fall back to the other version of the
protocol if the server turns out not to match your selection here;
instead, it will put up an error message and abort the connection.
This prevents an active attacker downgrading an intended SSH-2
connection to SSH-1.
The SSH-2 protocol permits you to run multiple data channels over
the same SSH connection, so that you can log in just once (and do
the expensive encryption setup just once) and then have more than
one terminal window open.
Each instance of PuTTY can still run at most one terminal session,
but using the controls in this box, you can configure PuTTY to check
if another instance of itself has already connected to the target
host, and if so, share that instance's SSH connection instead of
starting a separate new one.
To enable this feature, just tick the box `Share SSH connections if
possible'. Then, whenever you start up a PuTTY session connecting to
a particular host, it will try to reuse an existing SSH connection
if one is available. For example, selecting `Duplicate Session' from
the system menu will launch another session on the same host, and if
sharing is enabled then it will reuse the existing SSH connection.
When this mode is in use, the first PuTTY that connected to a given
server becomes the `upstream', which means that it is the one
managing the real SSH connection. All subsequent PuTTYs which reuse
the connection are referred to as `downstreams': they do not connect
to the real server at all, but instead connect to the upstream PuTTY
via local inter-process communication methods.
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.
The Kex panel (short for `key exchange') allows you to configure
options related to SSH-2 key exchange.
If you don't understand what any of this means, it's safe to leave
these settings alone.
This entire panel is only relevant to SSH protocol version 2; none
of these settings affect SSH-1 at all.
If the first algorithm 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.20).
These options control how often PuTTY will initiate a repeat key
exchange (`rekey'). You can also force a key exchange at any time
from the Special Commands menu (see section 3.1.3.2).
- `Max data before rekey' specifies the amount of data (in bytes)
that is permitted to flow in either direction before a rekey is
initiated. If this is set to zero, PuTTY will not rekey due to
transferred data. The SSH-2 protocol specification recommends a
limit of at most 1 gigabyte.
Host keys are used to prove the server's identity, and assure you
that the server is not being spoofed (either by a man-in-the-middle
attack or by completely replacing it on the network). See section
2.2 for a basic introduction to host keys.
PuTTY supports a variety of SSH-2 host key types, and allows you
to choose which one you prefer to use to identify the server.
Configuration is similar to cipher selection (see section 4.20).
If PuTTY already has one or more host keys stored for the server, it
will by default 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.20).
By default, PuTTY will adjust the preference order for SSH-2 host
key algorithms so that any host keys it already knows are moved to
the top of the list.
This prevents you from having to check and confirm a new host key
for a server you already had one for (e.g. because the server has
generated an alternative key of a type higher in PuTTY's preference
order, or because you changed the preference order itself).
One reason why you might want to do this is because the host name
PuTTY is connecting to is using round-robin DNS to return one of
multiple actual servers, and they all have different host keys. In
that situation, you might need to configure PuTTY to accept any of
a list of host keys for the possible servers, while still rejecting
any key not in that list.
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.
If this box contains at least one host key or fingerprint when PuTTY
makes an SSH connection, then PuTTY's automated host key management
is completely bypassed: the connection will be permitted if and only
if the host key presented by the server is one of the keys listed
in this box, and the host key store in the Registry will be neither
read _nor written_, unless you explicitly do so.
If the box is empty (as it usually is), then PuTTY's automated host
key management will work as normal.
In some environments, the SSH host keys for a lot of servers will
all be signed in turn by a central `certification authority' (`CA'
for short). This simplifies host key configuration for users,
because if they configure their SSH client to accept host keys
certified by that CA, then they don't need to individually confirm
each host key the first time they connect to that server.
First, load the CA's public key from a file, or paste it directly
into the `Public key of certification authority' edit box. If your
organisation signs its host keys in this way, they will publish the
public key of their CA so that SSH users can include it in their
configuration.
For the full syntax of the `Valid hosts' expression, see section
4.19.4.1.
Finally, choose an identifying name for this CA; enter that name
in the `Name for this CA' edit box at the top of the window, and
press `Save' to record the CA in your configuration. The name you
chose will appear in the list of saved CAs to the left of the `Save'
button.
The identifying name can be anything you like. It's there so that if
you store multiple certificates you can tell which is which later
when you want to edit or delete them. It also appears in the PuTTY
Event Log when a server presents a certificate signed by that CA.
The simplest thing you can enter in the `Valid hosts this key is
trusted to certify' edit box is just a hostname wildcard such as
`*.example.com'. This matches any host in any subdomain, so both
`ssh.example.com' and `login.dept.example.com' would match, but
`prod.example.net' would not.
But you can also enter multiple host name wildcards, and port number
ranges, and make complicated Boolean expressions out of them using
the operators `&&' for `and', `||' for `or', `!' for `not', and
parentheses.
For example, here are some other things you could enter.
If the algorithm PuTTY finds is below the `warn below here' line,
you will see a warning box when you make the connection:
This warns you that the first available encryption is not a very
secure one. Typically you would put the `warn below here' line
between the encryptions you consider secure and the ones you
consider substandard. By default, PuTTY supplies a preference order
intended to reflect a reasonable preference in terms of security and
speed.
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.23). (These are still forms of
authentication, even if you don't have to interact with them.)
If this option is enabled, then PuTTY will look for Pageant (the
SSH private-key storage agent) and attempt to authenticate with any
suitable public keys Pageant currently holds.
This option allows the SSH server to open forwarded connections back
to your local copy of Pageant. If you are not running Pageant, this
option will do nothing.
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.
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.
You can use the authentication agent Pageant so that you do not need
to explicitly configure a key here; see chapter 9.
(This is optional. If you don't know you need it, you can leave this
blank.)
If you have been provided with a plugin of this type, you can
configure it here, by entering a full command line in the `Plugin
command to run' box.
(If you want to _write_ a plugin of this type, see appendix H for
the full specification of how the plugin is expected to behave.)
If both of those checkboxes are disabled, PuTTY will not try any
form of GSSAPI at all, and the rest of this panel will be unused.
Occasionally you might find you have a need to run a session _not_
in a pseudo-terminal. In PuTTY, this is generally only useful for
very specialist purposes; although in Plink (see chapter 7) it is
the usual way of working.
The SSH protocol allows the client to send `terminal modes' for
the remote pseudo-terminal. These usually control the server's
expectation of the local terminal's behaviour.
If your server does not have sensible defaults for these modes, you
may find that changing them here helps, although the server is at
liberty to ignore your changes. If you don't understand any of this,
it's safe to leave these settings alone.
Some notable modes are described below; for fuller explanations, see
your server documentation.
- ERASE is the character that when typed by the user will delete
one space to the left. When set to `Auto' (the default setting),
this follows the setting of the local Backspace key in PuTTY
(see section 4.4.1).
The X11 panel allows you to configure forwarding of X11 over an SSH
connection.
- You may find this feature causes problems with some SSH servers,
which will not clean up XDM-AUTHORIZATION-1 data after a
session, so that if you then connect to the same server using
a client which only does MIT-MAGIC-COOKIE-1 and are allocated
the same remote display number, you might find that out-of-date
authentication data is still present on your server and your X
connections fail.
If you are using X11 forwarding, the local X server to which your
forwarded connections are eventually directed may itself require
authorisation.
One way in which this data might be made available is for the X
server to store it somewhere in a file which has the same format
as the Unix `.Xauthority' file. If this is how your Windows X
server works, then you can tell PuTTY where to find this file by
configuring this option. By default, PuTTY will not attempt to find
any authorisation for your local display.
The port forwarding section in the Tunnels panel shows a list of all
the port forwardings that PuTTY will try to set up when it connects
to the server. By default no port forwardings are set up, so this
list is empty.
- Enter a source port number into the `Source port' box. For local
forwardings, PuTTY will listen on this port of your PC. For
remote forwardings, your SSH server will listen on this port of
the remote machine. Note that most servers will not allow you to
listen on port numbers less than 1024.
In place of port numbers, you can enter service names, if they are
known to the local system. For instance, in the `Destination' box,
you could enter `popserver.example.com:pop3'.
You can modify the currently active set of port forwardings in mid-
session using `Change Settings' (see section 3.1.3.4). If you delete
a local or dynamic port forwarding in mid-session, PuTTY will stop
listening for connections on that port, so it can be re-used by
another program. If you delete a remote port forwarding, note that:
- The SSH-2 protocol does contain such a mechanism, but not all
SSH servers support it. (In particular, OpenSSH does not support
it in any version earlier than 3.9.)
If you ask to delete a remote port forwarding and PuTTY cannot make
the server actually stop listening on the port, it will instead
just start refusing incoming connections on that port. Therefore,
although the port cannot be reused by another program, you can at
least be reasonably sure that server-side programs can no longer
access the service at your end of the port forwarding.
The source port for a forwarded connection usually does not accept
connections from any machine except the SSH client or server machine
itself (for local and remote forwardings respectively). There are
controls in the Tunnels panel to change this:
- The `Remote ports do the same' option does the same thing for
remote-to-local port forwardings (so that machines other than
the SSH server machine can connect to the forwarded port.) Note
that this feature is only available in the SSH-2 protocol, and
not all SSH-2 servers support it (OpenSSH 3.0 does not, for
example).
Note that some operating systems may listen for incoming connections
in IPv4 even if you specifically asked for IPv6, because their IPv4
and IPv6 protocol stacks are linked together. Apparently Linux does
this, and Windows does not. So if you're running PuTTY on Windows
and you tick `IPv6' for a local or dynamic port forwarding, it will
_only_ be usable by connecting to it using IPv6; whereas if you do
the same on Linux, you can also use it with IPv4. However, ticking
`Auto' should always give you a port which you can connect to using
either protocol.
Not all SSH servers work properly. Various existing servers have
bugs in them, which can make it impossible for a client to talk to
them unless it knows about the bug and works around it.
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.
(The PuTTY project has a defined policy about when we're prepared to
add auto-detection for a bug workaround. See section B.6.)
If it believes the server to have this bug, PuTTY will stop using
ignore messages. If this bug is enabled when talking to a correct
server, the session will succeed, but keepalives will not work and
the session might be less cryptographically secure than it could be.
Some SSH servers cannot cope with repeat key exchange at all, and
will ignore attempts by the client to start one. Since PuTTY pauses
the session while performing a repeat key exchange, the effect of
this would be to cause the session to hang after an hour (unless
you have your rekey timeout set differently; see section 4.18.2 for
more about rekeys). Other, very old, SSH servers handle repeat key
exchange even more badly, and disconnect upon receiving a repeat key
exchange request.
It has been known for some SSH servers to get confused by this
message in one way or another - because it has a long name, or
because they can't cope with unrecognised request names even to the
extent of sending back the correct failure response, or because they
handle it sensibly but fill up the server's log file with pointless
spam, or whatever. PuTTY therefore supports this bug-compatibility
flag: if it believes the server has this bug, it will never send
its `[email protected]' request, and will make do
without its timing data.
When an SSH-2 channel is set up, each end announces the maximum size
of data packet that it is willing to receive for that channel. Some
servers ignore PuTTY's announcement and send packets larger than
PuTTY is willing to accept, causing it to report `Incoming packet
was garbled on decryption'.
You can work around this problem by manually enabling this bug flag,
which will cause PuTTY to wait to send its initial SSH greeting
until after it sees the greeting from the server.
If this bug is detected, PuTTY will pad its signatures in the way
OpenSSH expects. If this bug is enabled when talking to a correct
server, it is likely that no damage will be done, since correct
servers usually still accept padded signatures because they're used
to talking to OpenSSH.
The SSH key exchange method that uses Diffie-Hellman group exchange
was redesigned after its original release, to use a slightly more
sophisticated setup message. Almost all SSH implementations switched
over to the new version. (PuTTY was one of the last.) A few old
servers still only support the old one.
If this bug is detected, and the client and server negotiate Diffie-
Hellman group exchange, then PuTTY will send the old message now
known as SSH2_MSG_KEX_DH_GEX_REQUEST_OLD in place of the new
SSH2_MSG_KEX_DH_GEX_REQUEST.
Versions 2.3.0 and below of the SSH server software from ssh.com
compute the keys for their HMAC message authentication codes
incorrectly. A typical symptom of this problem is that PuTTY dies
unexpectedly at the beginning of the session, saying `Incorrect MAC
received on packet'.
If this bug is detected, PuTTY will compute its HMAC keys in the
same way as the buggy server, so that communication will still be
possible. If this bug is enabled when talking to a correct server,
communication will fail.
If this bug is detected, PuTTY will sign data in the way OpenSSH
expects. If this bug is enabled when talking to a correct server,
SSH-2 public-key authentication will fail.
(However, this protocol is also the same one used between instances
of PuTTY to implement connection sharing: see section 4.17.5. In
fact, in the Unix version of PuTTY, when a sharing upstream records
`Sharing this connection at [pathname]' in the Event Log, it's
possible to connect another instance of PuTTY directly to that Unix
socket, by entering its pathname in the host name box and selecting
`Bare ssh-connection' as the protocol!)
Many of the options under the SSH panel also affect this protocol,
although options to do with cryptography and authentication do not,
for obvious reasons.
The Serial panel allows you to configure options that only apply
when PuTTY is connecting to a local serial line.
The `Serial line to connect to' box allows you to choose which
serial line you want PuTTY to talk to, if your computer has more
than one serial port.
The `Speed' box allows you to choose the speed (or `baud rate') at
which to talk to the serial line. Typical values might be 9600,
19200, 38400 or 57600. Which one you need will depend on the device
at the other end of the serial cable; consult the manual for that
device if you are in doubt.
The `Data bits' box allows you to choose how many data bits are
transmitted in each byte sent or received through the serial line.
Typical values are 7 or 8.
4.29.4 Selecting the number of stop bits
The `Stop bits' box allows you to choose how many stop bits are used
in the serial line protocol. Typical values are 1, 1.5 or 2.
The `Parity' box allows you to choose what type of parity checking
is used on the serial line. The settings are:
The `Flow control' box allows you to choose what type of flow
control checking is used on the serial line. The settings are:
- `RTS/CTS': flow control is done using the RTS and CTS wires on
the serial line.
- `DSR/DTR': flow control is done using the DSR and DTR wires on
the serial line.
The Telnet panel allows you to configure options that only apply to
Telnet sessions.
Sadly there was a typing error in the standard when it was issued,
and two vital function codes were specified the wrong way round. BSD
implementations did not change, and the standard was not corrected.
Therefore, it's possible you might find either BSD or RFC-compliant
implementations out there. This switch allows you to choose which
one PuTTY claims to be.
If this box is checked, several key sequences will have their normal
actions modified:
- the Backspace key on the keyboard will send the Telnet special
backspace code;
You probably shouldn't enable this unless you know what you're
doing.
Unlike most other remote login protocols, the Telnet protocol has
a special `new line' code that is not the same as the usual line
endings of Control-M or Control-J. By default, PuTTY sends the
Telnet New Line code when you press Return, instead of sending
Control-M as it does in most other protocols.
The Rlogin panel allows you to configure options that only apply to
Rlogin sessions.
Windows does not have this restriction: _any_ user can initiate
an outgoing connection from a low-numbered port. Hence, the
Rlogin `.rhosts' mechanism is completely useless for securely
distinguishing several different users on a Windows machine. If you
have a `.rhosts' entry pointing at a Windows PC, you should assume
that _anyone_ using that PC can spoof your username in an Rlogin
connection and access your account on the server.
The `Local username' control allows you to specify what user name
PuTTY should claim you have, in case it doesn't match your Windows
user name (or in case you didn't bother to set up a Windows user
name).
The SUPDUP panel allows you to configure options that only apply
to SUPDUP sessions. See section 3.10 for more about the SUPDUP
protocol.
This controls whether the terminal will perform scrolling when the
cursor goes below the last line, or if the cursor will return to the
first line.
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
This batch file needs two auxiliary files: `PUTTYRND.REG' which sets
up an initial safe location for the `PUTTY.RND' random seed file,
and `PUTTYDEL.REG' which destroys everything in the Registry once
it's been successfully saved back to the file.
Here is `PUTTYDEL.REG':
REGEDIT4
[-HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
REGEDIT4
[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.
PSCP, the PuTTY Secure Copy client, is a tool for transferring files
securely between computers using an SSH connection.
If you have an SSH-2 server, you might prefer PSFTP (see chapter
6) for interactive use. PSFTP does not in general work with SSH-1
servers, however.
PSCP is a command line application. This means that you cannot just
double-click on its icon to run it and instead you have to bring up
a console window. With Windows 95, 98, and ME, this is called an
`MS-DOS Prompt' and with Windows NT, 2000, and XP, it is called a
`Command Prompt'. It should be available from the Programs section
of your Start Menu.
set PATH=C:\path\to\putty\directory;%PATH%
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.
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:
C:\>pscp
PuTTY Secure Copy client
Release 0.79
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
-pwfile file login with password read from specified file
-1 -2 force use of particular SSH protocol version
-ssh -ssh-connection
force use of particular SSH protocol variant
-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
-no-trivial-auth
disconnect if SSH authentication succeeds trivially
-hostkey keyid
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
-logoverwrite
-logappend
control what happens when a log file already exists
PSCP will attempt to use the newer SFTP protocol (part of SSH-2)
where possible, which does not suffer from this security flaw. If
you are talking to an SSH-2 server which supports SFTP, you will
never see this warning. (You can force use of the SFTP protocol, if
available, with `-sftp' - see section 5.2.2.6.)
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'
The login name on the remote server. If this is omitted, and `host'
is a PuTTY saved session, PSCP will use any username specified by
that saved session. Otherwise, PSCP will attempt to use the local
Windows username.
5.2.1.2 `host'
5.2.1.3 `source'
5.2.1.4 `target'
pscp [email protected]:/home/tom/.emacs .
5.2.2 Options
PSCP accepts all the general command line options supported by the
PuTTY tools, except the ones which make no sense in a file transfer
utility. See section 3.11.3 for a description of these options. (The
ones not supported by PSCP are clearly marked.)
PSCP also supports some of its own options. The following sections
describe PSCP's specific command-line options.
The SCP protocol does not contain within itself a means of listing
files. If SCP is in use, this option therefore assumes that the
server responds appropriately to the command `ls -la'; this may not
work with all servers.
By default, files copied with PSCP are timestamped with the date
and time they were copied. The `-p' option preserves the original
timestamp on copied files.
The fields in this display are (from left to right), filename, size
(in kilobytes) of file transferred so far, estimate of how fast the
file is being transferred (in kilobytes per second), estimated time
that the transfer will be complete, and percentage of the file so
far transferred. The `-q' option to PSCP suppresses the printing of
these statistics.
By default, PSCP will only copy files. Any directories you specify
to copy will be skipped, as will their contents. The `-r' option
tells PSCP to descend into any directories you specify, and to copy
them and their contents. This allows you to use PSCP to transfer
whole directory structures between machines.
If you use the `-batch' option, PSCP will never give an interactive
prompt while establishing the connection. If the server's host key
is invalid, for example (see section 2.2), then the connection will
simply be abandoned instead of asking you what to do next.
The older SCP protocol does not have a written specification and
leaves a lot of detail to the server platform. Wildcards are
expanded on the server. The simple design means that any wildcard
specification supported by the server platform (such as brace
expansion) can be used, but also leads to interoperability issues
such as with filename quoting (for instance, where filenames contain
spaces), and also the security issue described in section 5.2.1.
Normally PSCP will attempt to use the SFTP protocol, and only fall
back to the SCP protocol if SFTP is not available on the server.
The `-scp' option forces PSCP to use the SCP protocol or quit.
The `-sftp' option forces PSCP to use the SFTP protocol or quit.
When this option is specified, PSCP looks harder for an SFTP server,
which may allow use of SFTP with SSH-1 depending on server setup.
- Run PuTTY, and create a PuTTY saved session (see section 4.1.2)
which specifies your private key file (see section 4.22.1). You
will probably also want to specify a username to log in as (see
section 4.15.1).
- In PSCP, you can now use the name of the session instead of
a hostname: type `pscp sessionname:file localfile', where
`sessionname' is replaced by the name of your saved session.
Secondly, you can supply the name of a private key file on the
command line, with the `-i' option. See section 3.11.3.18 for more
information.
- PSCP should work on virtually every SSH server. PSFTP uses the
new SFTP protocol, which is a feature of SSH-2 only. (PSCP
will also use this protocol if it can, but there is an SSH-1
equivalent it can fall back to if it cannot.)
- PSFTP allows you to run an interactive file transfer session,
much like the Windows `ftp' program. You can list the contents
of directories, browse around the file system, issue multiple
`get' and `put' commands, and eventually log out. By contrast,
PSCP is designed to do a single file transfer operation and
immediately terminate.
The usual way to start PSFTP is from a command prompt, much like
PSCP. To do this, it will need either to be on your `PATH' or in
your current directory. To add the directory containing PSFTP to
your `PATH' environment variable, type into the console window:
set PATH=C:\path\to\putty\directory;%PATH%
psftp server.example.com
or perhaps
psftp [email protected]
C:\>psftp
psftp: no hostname specified; use "open host.name" to connect
psftp>
PSFTP accepts all the general command line options supported by the
PuTTY tools, except the ones which make no sense in a file transfer
utility. See section 3.11.3 for a description of these options. (The
ones not supported by PSFTP are clearly marked.)
PSFTP also supports some of its own options. The following sections
describe PSFTP's specific command-line options.
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).
You might want this to happen if you wanted to delete a file and
didn't care if it was already not present, for example.
If you use the `-batch' option, PSFTP will never give an interactive
prompt while establishing the connection. If the server's host key
is invalid, for example (see section 2.2), then the connection will
simply be abandoned instead of asking you what to do next.
Once you have started your PSFTP session, you will see a `psftp>'
prompt. You can now type commands to perform file-transfer
functions. This section lists all the available commands.
Sometimes you will need to specify file names that _contain_ spaces.
In order to do this, you can surround the file name with double
quotes. This works equally well for local file names and remote file
names:
The double quotes themselves will not appear as part of the file
names; they are removed by PSFTP and their only effect is to stop
the spaces inside them from acting as word separators.
If you need to _use_ a double quote (on some types of remote system,
such as Unix, you are allowed to use double quotes in file names),
you can do this by doubling it. This works both inside and outside
double quotes. For example, this command
will take a file whose current name is `"this"' (with a double quote
character at the beginning and the end) and rename it to a file
whose name is `a file with "quotes" in it'.
(The one exception to the PSFTP quoting rules is the `!' command,
which passes its command line straight to Windows without splitting
it up into words at all. See section 6.2.19.)
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.
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.
If you type `help', PSFTP will give a short list of the available
commands.
If you type `help' with a command name - for example, `help get'
- then PSFTP will give a short piece of help on that particular
command.
6.2.7 The `cd' and `pwd' commands: changing the remote working directory
6.2.8 The `lcd' and `lpwd' commands: changing the local working directory
To download a file from the server and store it on your local PC,
you use the `get' command.
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'.
To fetch an entire directory recursively, you can use the `-r'
option:
get -r mydir
get -r mydir newname
(If you want to fetch a file whose name starts with a hyphen, you
may have to use the `--' special argument, which stops `get' from
interpreting anything as a switch after it. For example, `get -- -
silly-name-'.)
To upload a file to the server from your local PC, you use the `put'
command.
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'.
put -r mydir
put -r mydir newname
(If you want to send a file whose name starts with a hyphen, you
may have to use the `--' special argument, which stops `put' from
interpreting anything as a switch after it. For example, `put -- -
silly-name-'.)
6.2.11 The `mget' and `mput' commands: fetch or send multiple files
`mget' works almost exactly like `get', except that it allows you to
specify more than one file to fetch at once. You can do this in two
ways:
The `-r' and `--' options from `get' are also available with `mget'.
If a file transfer fails half way through, and you end up with half
the file stored on your disk, you can resume the file transfer using
the `reget' and `reput' commands. These work exactly like the `get'
and `put' commands, but they check for the presence of the half-
written destination file and start transferring from where the last
attempt left off.
The syntax of `reget' and `reput' is exactly the same as the syntax
of `get' and `put':
reget myfile.dat
reget myfile.dat newname.dat
reget -r mydir
To list the files in your remote working directory, just type `dir'.
dir /home/fred
dir sources
dir /home/fred/*.txt
dir sources/*.c
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).
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
mkdir newstuff
rmdir oldstuff
rmdir *.old ancient
To rename a single file on the server, type `mv', then the current
file name, and then the new file name:
mv oldfile newname
You can also move the file into a different directory and change the
name:
mv oldfile dir/newname
mv file dir
mv file1 dir1/file2 dir2
mv *.c *.h ..
The `rename' and `ren' commands work exactly the same way as `mv'.
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.
using the Windows `ren' command to rename files on your local PC.
- Run PuTTY, and create a PuTTY saved session (see section 4.1.2)
which specifies your private key file (see section 4.22.1). You
will probably also want to specify a username to log in as (see
section 4.15.1).
- In PSFTP, you can now use the name of the session instead of
a hostname: type `psftp sessionname', where `sessionname' is
replaced by the name of your saved session.
Secondly, you can supply the name of a private key file on the
command line, with the `-i' option. See section 3.11.3.18 for more
information.
Plink is a command line application. This means that you cannot just
double-click on its icon to run it and instead you have to bring
up a console window. In Windows 95, 98, and ME, this is called an
`MS-DOS Prompt', and in Windows NT, 2000, and XP, it is called a
`Command Prompt'. It should be available from the Programs section
of your Start Menu.
set PATH=C:\path\to\putty\directory;%PATH%
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.
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:
C:\>plink
Plink: command-line connection utility
Release 0.79
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
-ssh-connection
force use of the bare ssh-connection 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:
-pwfile file login with password read from specified file
-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 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
-no-trivial-auth
disconnect if SSH authentication succeeds trivially
-noshare disable use of connection sharing
-share enable use of connection sharing
-hostkey keyid
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
-logoverwrite
-logappend
control what happens when a log file already exists
-shareexists
test whether a connection-sharing upstream exists
C:\>plink login.example.com
You should then be able to log in as normal and run a session. The
output sent by the server will be written straight to your command
prompt window, which will most likely not interpret terminal control
codes in the way the server expects it to. So if you run any full-
screen applications, for example, you can expect to see strange
characters appearing in your window. Interactive connections like
this are not the main point of Plink.
C:\>plink my-ssh-session
Sent username "fred"
Authenticating with public key "fred@winbox"
Last login: Thu Dec 6 19:25:33 2001 from :0.0
fred@flunky:~$
(You can also use the `-load' command-line option to load a saved
session; see section 3.11.3.1. If you use `-load', the saved session
exists, and it specifies a hostname, you cannot also specify a
`host' or `user@host' argument - it will be treated as part of the
remote command.)
More typically Plink is used with the SSH protocol, to enable you
to talk directly to a program running on the server. To do this you
have to ensure Plink is _using_ the SSH protocol. You can do this in
several ways:
- Set up a PuTTY saved session that describes the server you are
connecting to, and that also specifies the protocol as SSH.
To avoid being prompted for the server host key when using Plink for
an automated connection, you can 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 `Accept'
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. Alternatively, you can specify the appropriate
host key(s) on Plink's command line every time you use it; see
section 3.11.3.22.
- Use the `-l' option to specify a user name on the command line.
For example, `plink login.example.com -l fred'.
- Set up a PuTTY saved session that describes the server you are
connecting to, and that also specifies the username to log in as
(see section 4.15.1).
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:
C:\>
Or, if you have set up a saved session with all the connection
details:
C:\>
Then you can set up other programs to run this Plink command and
talk to it as if it were a process on the server machine.
Plink accepts all the general command line options supported by the
PuTTY tools. See section 3.11.3 for a description of these options.
Plink also supports some of its own options. The following sections
describe Plink's specific command-line options.
If you use the `-batch' option, Plink will never give an interactive
prompt while establishing the connection. If the server's host key
is invalid, for example (see section 2.2), then the connection will
simply be abandoned instead of asking you what to do next.
If you specify the `-s' option, Plink passes the specified command
as the name of an SSH `subsystem' rather than an ordinary command
line.
By default, this only happens for output channels which are sent
to a Windows console device, or a Unix terminal device. (Any
output stream going somewhere else is likely to be needed by an 8-
bit protocol and must not be tampered with at all.) It also stops
happening if you tell Plink to allocate a remote pseudo-terminal
(see section 3.11.3.12 and section 4.24.1), on the basis that in
that situation you often _want_ escape sequences from the server to
go to your terminal.
But in case Plink guesses wrong about whether you want this
sanitisation, you can override it in either direction, using one of
these options:
`-sanitise-stderr'
`-no-sanitise-stderr'
`-sanitise-stdout'
`-no-sanitise-stdout'
But if you still find the protective prompt inconvenient, and you
trust the server not to try a trick like this, you can turn it off
using the `-no-antispoof' option.
To use Plink with CVS, you need to set the environment variable
`CVS_RSH' to point to Plink:
set CVS_RSH=\path\to\plink.exe
Plink can also be used with WinCVS. Firstly, arrange for Plink to be
able to connect to a remote host non-interactively, as described in
section 7.2.2.
Next, select `Command Line' from the WinCVS `Admin' menu, and type a
CVS command as in section 7.4, for example:
So you generate a key pair on your own computer, and you copy the
public key to the server. Then, when the server asks you to prove
who you are, PuTTY can generate a signature using your private key.
The server can verify that signature (since it has your public key)
and allow you to log in. Now if the server is hacked or spoofed, the
attacker does not gain your private key or password; they only gain
one signature. And signatures cannot be re-used, so they have gained
nothing.
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.
- Once you have generated the key, select a comment field (section
8.2.7) and a passphrase (section 8.2.8).
- Now you're ready to save the private key to disk; press the
`Save private key' button. (See section 8.2.10).
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.12), or by using the `Save public key' button (section 8.2.11).
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.14)
and the public key will be available for copying and pasting again.
- An ECDSA (elliptic curve DSA) key for use with the SSH-2
protocol.
PuTTYgen can also generate an RSA key suitable for use with the
old SSH-1 protocol (which only supports RSA); for this, you need
to select the `SSH-1 (RSA)' option. Since the SSH-1 protocol is no
longer considered secure, it's rare to need this option.
The `Number of bits' input box allows you to choose the strength of
the key PuTTYgen will generate.
- For RSA and DSA, 2048 bits should currently be sufficient for
most purposes. (Smaller keys of these types are no longer
considered secure, and PuTTYgen will warn if you try to generate
them.)
- For ECDSA, only 256, 384, and 521 bits are supported,
corresponding to NIST-standardised elliptic curves. (Elliptic-
curve keys do not need as many bits as RSA keys for equivalent
security, so these numbers are smaller than the RSA
recommendations.)
- For EdDSA, the only valid sizes are 255 bits (these keys are
also known as `Ed25519' and are commonly used) and 448 bits
(`Ed448', which is much less common at the time of writing).
(256 is also accepted for backward compatibility, but the effect
is the same as 255.)
On the `Key' menu, you can also optionally change the method for
generating the prime numbers used in the generated key. This is
used for RSA and DSA keys only. (The other key types don't require
generating prime numbers at all.)
For RSA keys, there's also an option on the `Key' menu to use
`strong' primes as the prime factors of the public key. A `strong'
prime is a prime number chosen to have a particular structure that
makes certain factoring algorithms more difficult to apply, so some
security standards recommend their use. However, the most modern
factoring algorithms are unaffected, so this option is probably not
worth turning on _unless_ you have a local standard that recommends
it.
Once you have chosen the type of key you want, and the strength of
the key, press the `Generate' button and PuTTYgen will begin the
process of actually generating the key.
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.
When the progress bar reaches the end, PuTTYgen will begin creating
the key. The progress bar will reset to the start, and gradually
move up again to track the progress of the key generation. It will
not move evenly, and may occasionally slow down to a stop; this
is unfortunately unavoidable, because key generation is a random
process and it is impossible to reliably predict how long it will
take.
The `Key fingerprint' box shows you a fingerprint value for the
generated key. This is derived cryptographically from the _public_
key value, so it doesn't need to be kept secret; it is supposed to
be more manageable for human beings than the public key itself.
If you have more than one key and use them for different purposes,
you don't need to memorise the key fingerprints in order to tell
them apart. PuTTYgen allows you to enter a _comment_ for your key,
which will be displayed whenever PuTTY or Pageant asks you for the
passphrase.
The default comment format, if you don't specify one, contains the
key type and the date of generation, such as `rsa-key-20011212'.
Another commonly used approach is to use your name and the name of
the computer the key will be used on, such as `simon@simons-pc'.
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.
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.
If you leave the passphrase fields blank, the key will be saved
unencrypted. You should _not_ do this without good reason; if you
do, your private key file on disk will be all an attacker needs to
gain access to any machine configured to accept that key. If you
want to be able to log in without having to type a passphrase every
time, you should consider using Pageant (chapter 9) so that your
decrypted key is only held in memory rather than on disk.
Under special circumstances you may genuinely _need_ to use a key
with no passphrase; for example, if you need to run an automated
batch script that needs to make an SSH connection, you can't be
there to type the passphrase. In this case we recommend you generate
a special key for each specific batch script (or whatever) that
needs one, and on the server side you should arrange that each
key is _restricted_ so that it can only be used for that specific
purpose. The documentation for your SSH server should explain how to
do this (it will probably vary between servers).
To get your key signed by a CA, you'll probably send the CA the new
_public_ key (not the private half), and get back a modified version
of the public key with the certificate included.
If you want to incorporate the certificate into your PPK file for
convenience, you can use the `Add certificate to key' menu option in
PuTTYgen's `Key' menu. This will give you a single file containing
your private key and the certificate, which is everything you need
to authenticate to a server prepared to accept that certificate.
Once you have generated a key, set a comment field and set a
passphrase, you are ready to save your private key to disk.
Press the `Save private key' button. PuTTYgen will put up a dialog
box asking you where to save the file. Select a directory, type in a
file name, and press `Save'.
(You can optionally change some details of the PPK format for your
saved key files; see section 8.2.13. But the defaults should be fine
for most purposes.)
RFC 4716 specifies a standard format for storing SSH-2 public keys
on disk. Some SSH servers (such as ssh.com's) require a public
key in this format in order to accept authentication with the
corresponding private key. (Others, such as OpenSSH, use a different
format; see section 8.2.12.)
To save your public key in the SSH-2 standard format, press the
`Save public key' button in PuTTYgen. PuTTYgen will put up a dialog
box asking you where to save the file. Select a directory, type in a
file name, and press `Save'.
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.
The `Public key for pasting into OpenSSH authorized_keys file' gives
the public-key data in the correct one-line format. Typically you
will want to select the entire contents of the box using the mouse,
press Ctrl+C to copy it to the clipboard, and then paste the data
into a PuTTY session which is already connected to the server.
You might need to select PPK version 2 if you need your private key
file to be loadable in older versions of PuTTY (0.74 and older), or
in other tools which do not yet support the version 3 format (which
was introduced in 2021).
To load an existing key, press the `Load' button. PuTTYgen will put
up a dialog box where you can browse around the file system and find
your key file. Once you select the file, PuTTYgen will ask you for a
passphrase (if necessary) and will then display the key details in
the same way as if it had just generated the key.
If you use the Load command to load a foreign key format, it will
work, but you will see a message box warning you that the key you
have loaded is not a PuTTY native key. See section 8.2.15 for
information about importing foreign key formats.
Using the `Import' command from the `Conversions' menu, PuTTYgen can
load SSH-2 private keys in OpenSSH's format and ssh.com's format.
Once you have loaded one of these key types, you can then save it
back out as a PuTTY-format key (`*.PPK') so that you can use it with
the PuTTY suite. The passphrase will be unchanged by this process
(unless you deliberately change it). You may want to change the key
comment before you save the key, since some OpenSSH key formats
contained no space for a comment, and ssh.com's default comment
format is long and verbose.
For OpenSSH there are two options. Modern OpenSSH actually has two
formats it uses for storing private keys: an older (`PEM-style')
format, and a newer `native' format with better resistance to
passphrase guessing and support for comments. `Export OpenSSH key'
will automatically choose the oldest format supported for the key
type, for maximum backward compatibility with older versions of
OpenSSH; for newer key types like Ed25519, it will use the newer
format as that is the only legal option. If you have some specific
reason for wanting to use OpenSSH's newer format even for RSA,
DSA, or ECDSA keys - for instance, you know your file will only
be used by OpenSSH 6.5 or newer (released in 2014), and want the
extra security - you can choose `Export OpenSSH key (force new file
format)'.
Most clients for the older SSH-1 protocol use a standard format for
storing private keys on disk. PuTTY uses this format as well; so if
you have generated an SSH-1 private key using OpenSSH or ssh.com's
client, you can use it with PuTTY, and vice versa. Hence, the export
options are not available if you have generated an SSH-1 key.
-t _keytype_
-b _bits_
--primes _method_
--strong-rsa
When generating an RSA key, make sure the prime factors of the
key modulus are `strong primes'. See section 8.2.4.
--ppk-param _key_=_value_,...
Allows setting all the same details of the PPK save file format
described in section 8.2.13.
version
kdf
memory
time
passes
-E _fptype_
Connect to your SSH server using PuTTY with the SSH protocol. When
the connection succeeds you will be prompted for your user name and
password to login. Once logged in, you must configure the server to
accept your public key for authentication:
- For other SSH server software, you should refer to the manual
for that server.
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
- Specify the key file on the command line with the `-i' option.
See section 3.11.3.18 for details.
- Load the private key into Pageant (see chapter 9). In this case
PuTTY will automatically try to use it for authentication if it
can.
Before you run Pageant, you need to have a private key in `*.PPK'
format. See chapter 8 to find out how to generate and use one.
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.)
The Pageant window contains a list box. This shows the private keys
Pageant is holding. When you start Pageant, it has no keys, so the
list box will be empty. After you add one or more keys, they will
show up in the list box.
To add a key to Pageant, press the `Add Key' button. Pageant will
bring up a file dialog, labelled `Select Private Key File'. Find
your private key file in this dialog, and press `Open'.
Pageant will now load the private key. If the key is protected by
a passphrase, Pageant will ask you to type the passphrase. When
the key has been loaded, it will appear in the list in the Pageant
window.
Now start PuTTY and open an SSH session to a site that accepts your
key. PuTTY will notice that Pageant is running, retrieve the key
automatically from Pageant, and use it to authenticate. You can now
open as many PuTTY sessions as you like without having to type your
passphrase again.
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.
If you want Pageant to stay running but forget all the keys it has
acquired, select `Remove All Keys' from the System tray menu.
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.
The large list box in the Pageant main window lists the private
keys that are currently loaded into Pageant. The list might look
something like this:
Ed25519 SHA256:TddlQk20DVs4LRcAsIfDN9pInKpY06D+h4kSHwWAj4w
RSA 2048 SHA256:8DFtyHm3kQihgy52nzX96qMcEVOq7/yJmmwQQhBWYFg
- The type of the key. Currently, this can be `RSA' (an RSA key
for use with the SSH-2 protocol), `DSA' (a DSA key for use with
the SSH-2 protocol), `NIST' (an ECDSA key for use with the
SSH-2 protocol), `Ed25519' (an Ed25519 key for use with the
SSH-2 protocol), `Ed448' (an Ed448 key for use with the SSH-
2 protocol), or `SSH-1' (an RSA key for use with the old SSH-
1 protocol). (If the key has an associated certificate, this is
shown here with a `cert' suffix.)
- The size (in bits) of the key, for key types that come in
different sizes. (For ECDSA `NIST' keys, this is indicated as
`p256' or `p384' or `p521'.)
- The fingerprint for the public key. This should be the same
fingerprint given by PuTTYgen, and (hopefully) also the same
fingerprint shown by remote utilities such as `ssh-keygen' when
applied to your `authorized_keys' file.
(This is not the only way to add a private key to Pageant. You can
also add one from a remote system by using agent forwarding; see
section 9.4 for details.)
If you need to remove a key from Pageant, select that key in the
list box, and press the `Remove Key' button. Pageant will remove the
key from its memory.
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.
You can arrange for Pageant to start another program once it has
initialised itself and loaded any keys specified on its command
line. This program (perhaps a PuTTY, or a WinCVS making use of
Plink, or whatever) will then be able to use the keys Pageant has
loaded.
To refer to this file from your main OpenSSH configuration, you can
use the `Include' directive. For example, you might run Pageant like
this (with your own username substituted, of course):
Include pageant.conf
There are other versions of OpenSSH for Windows, notably the one
that comes with Windows git. Those will likely not work with the
same configuration, because they tend to depend on Unix emulation
layers like MinGW or MSys, so they won't speak Windows native
pathname syntax or understand named pipes. The above instructions
will only work with Windows's own version of OpenSSH.
So, if you want to use Windows git with an SSH key held in
Pageant, you'll have to set the environment variable GIT_SSH,
to point at a different program. You could point it at
c:\Windows\System32\OpenSSH\ssh.exe once you've done this setup -
but it's just as easy to point it at Plink!
SSH_AUTH_SOCK=/mnt/c/Users/Simon/.ssh/agent.sock
IdentityAgent /mnt/c/Users/Simon/.ssh/agent.sock
although doing it like that may mean that ssh-add commands won't
find the agent, even though ssh itself will.
Start Pageant with the `--keylist' option to show the main window as
soon as it starts up.
If this has worked, your applications on the server should now have
access to a Unix domain socket which the SSH server will forward
back to PuTTY, and PuTTY will forward on to the agent. To check that
this has actually happened, you can try this command on Unix server
machines:
If the result line comes up blank, agent forwarding has not been
enabled at all.
Now if you run `ssh' on the server and use it to connect through to
another server that accepts one of the keys in Pageant, you should
be able to log in without a password:
and then it's available to every machine that has agent forwarding
available (not just the ones downstream of the place you added it).
This works the same way whether the key is used by an instance of
PuTTY running locally, or a remote client connecting to Pageant
through agent forwarding.
To add a key to Pageant in this encrypted form, press the `Add Key
(encrypted)' button in the Pageant main window, or alternatively
right-click on the Pageant icon in the system tray and select `Add
Key (encrypted)' from there. Pageant will bring up a file dialog, in
just the same way as it would for the plain `Add Key' button. But it
won't ask for a passphrase. Instead, the key will be listed in the
main window with `(encrypted)' after it.
After a key has been decrypted for the first use, it remains
decrypted, so that it can be used again. The main window will list
the key with `(re-encryptable)' after it. You can revert it to the
previous state, where a passphrase is required, using the `Re-
encrypt' button in the Pageant main window.
You can also `re-encrypt' all keys that were added encrypted by
choosing `Re-encrypt All Keys' from the System tray menu. (Note that
this does _not_ discard cleartext keys that were not previously
added encrypted!)
This chapter lists a number of common error messages which PuTTY and
its associated tools can produce, and explains what they mean in
more detail.
We do not attempt to list _all_ error messages here: there are many
which should never occur, and some which should be self-explanatory.
If you get an error message which is not listed in this chapter and
which you don't understand, report it to us as a bug (see appendix
B) and we will add documentation for it.
This error message occurs when PuTTY connects to a new SSH server.
Every server identifies itself by means of a host key; once PuTTY
knows the host key for a server, it will be able to detect if a
malicious attacker redirects your connection to another machine.
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 message, followed by `The server's host key does not match
the one PuTTY has cached for this server', means that PuTTY has
connected to the SSH server before, knows what its host key _should_
be, but has found a different one.
(If the message instead talks about a `certified host key', see
instead section 10.3.)
This may mean that a malicious attacker has replaced your server
with a different one, or has redirected your network connection
to their own machine. On the other hand, it may simply mean that
the administrator of your server has accidentally changed the key
while upgrading the SSH software; this _shouldn't_ happen but it is
unfortunately possible.
You should contact your server's administrator and see whether they
expect the host key to have changed. If so, verify the new host key
in the same way as you would if it was new.
10.3 `This server presented a certified host key which was signed by a
different certification authority ...'
One reason why this can happen is a deliberate attack. Just like an
ordinary man-in-the-middle attack which substitutes a wrong host
key, a particularly ambitious attacker might substitute an entire
wrong certification authority, and hope that you connect anyway.
But it's also possible in some situations that this error might
arise legitimately. For example, if your organisation's IT
department has just rolled out a new CA key which you haven't yet
entered in PuTTY's configuration, or if your CA configuration
involves two overlapping domains, or something similar.
If the server genuinely only supports SSH-1, then you need to either
change the `SSH protocol version' setting (see section 4.17.4), or
use the `-1' command-line option; in any case, you should not treat
the resulting connection as secure.
You might start seeing this message with new versions of PuTTY
(from 0.68 onwards) where you didn't before, because it used to be
possible to configure PuTTY to automatically fall back from SSH-2 to
SSH-1. This is no longer supported, to prevent the possibility of a
downgrade attack.
10.5 `The first cipher supported by the server is ... below the
configured warning threshold'
This occurs when the SSH server does not offer any ciphers which you
have configured PuTTY to consider strong enough. By default, PuTTY
puts up this warning only for Blowfish, single-DES, and Arcfour
encryption.
10.6 `Remote side sent disconnect message type 2 (protocol error): "Too
many authentication failures for root"'
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.22.1); 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.
On the server, this can be worked around by disabling public-key
authentication or (for Sun SSH only) by increasing `MaxAuthTries' in
`sshd_config'.
This occurs when PuTTY tries to allocate more memory than the system
can give it. This _may_ happen for genuine reasons: if the computer
really has run out of memory, or if you have configured an extremely
large number of lines of scrollback in your terminal. PuTTY is
not able to recover from running out of memory; it will terminate
immediately after giving this error.
However, this error can also occur when memory is not running out at
all, because PuTTY receives data in the wrong format. In SSH-2 and
also in SFTP, the server sends the length of each message before the
message itself; so PuTTY will receive the length, try to allocate
space for the message, and then receive the rest of the message.
If the length PuTTY receives is garbage, it will try to allocate
a ridiculous amount of memory, and will terminate with an `Out of
memory' error.
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).
This can also happen in PSCP or PSFTP, if your login scripts on the
server generate output: the client program will be expecting an
SFTP message starting with a length, and if it receives some text
from your login scripts instead it will try to interpret them as a
message length. See question A.7.4 for details of this.
Any error beginning with the word `Internal' should _never_ occur.
If it does, there is a bug in PuTTY by definition; please see
appendix B and report it to us.
10.9 `Unable to use key file', `Couldn't load private key', `Couldn't
load this key'
10.10 `Server refused our key', `Server refused our public key', `Key
refused'
If you see one of these messages, it means that PuTTY has sent a
public key to the server and offered to authenticate with it, and
the server has refused to accept authentication. This usually means
that the server is not configured to accept this key to authenticate
this user.
If you see one of these messages, it means that the server has
refused all the forms of authentication PuTTY has tried and it has
no further ideas.
It may be worth checking the Event Log for diagnostic messages from
the server giving more detail.
This error can be caused by buggy SSH-1 servers that fail to cope
with the various strategies we use for camouflaging passwords in
transit. Upgrade your server, or use the workarounds described in
section 4.27.14 and possibly section 4.27.15.
This error indicates that PuTTY has run out of ways to authenticate
you to an SSH server. This may be because PuTTY has TIS or keyboard-
interactive authentication disabled, in which case see section
4.21.5 and section 4.21.6.
This error occurs when PuTTY decrypts an SSH packet and its checksum
is not correct. This probably means something has gone wrong in the
encryption or decryption process. It's difficult to tell from this
error message whether the problem is in the client, in the server,
or in between.
This error occurs when PuTTY decrypts an SSH packet and the
decrypted data makes no sense. This probably means something has
gone wrong in the encryption or decryption process. It's difficult
to tell from this error message whether the problem is in the
client, in the server, or in between.
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.27.13) or `Ignores SSH-2 maximum packet size' (see section 4.27.5)
on the Bugs panel.
A common reason why people see one of these messages is because they
used SSH to log in as one user (let's say `fred'), and then used
the Unix `su' command to become another user (typically `root').
The original user, `fred', has access to the X authentication data
provided by the SSH server, and can run X applications which are
forwarded over the SSH connection. However, the second user (`root')
does not automatically have the authentication data passed on to it,
so attempting to run an X application as that user often fails with
this error.
(It can also occur if you are using keepalives in your connection.
Other people have reported that keepalives _fix_ this error for
them. See section 4.14.1 for a discussion of the pros and cons of
keepalives.)
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.
However, the most common reason to see this message is if you are
connecting through a firewall or a NAT router which has timed the
connection out. See question A.7.8 in the FAQ for more details.
You may be able to improve the situation by using keepalives; see
section 4.14.1 for details on this.
This error means that the network connection PuTTY tried to make to
your server was rejected by the server. Usually this happens because
the server does not provide the service which PuTTY is trying to
access.
Check that you are connecting with the correct protocol (SSH,
Telnet, etc), and check that the port number is correct. If that
fails, consult the administrator of your server.
This error can also be caused by a firewall in between you and the
server, which rejects the connection and sends back the same type of
error packet as the real server would have sent.
This error means that the network connection PuTTY tried to make to
your server received no response at all from the server. Usually
this happens because the server machine is completely isolated from
the network, or because it is turned off.
Check that you have correctly entered the host name or IP address
of your server machine. If that fails, consult the administrator of
your server.
Unix also generates this error when it tries to send data down a
connection and contact with the server has been completely lost
during a connection. (There is a delay of minutes before Unix gives
up on receiving a reply from the server.) This can occur if you type
things into PuTTY while the network is down, but it can also occur
if PuTTY decides of its own accord to send data: due to a repeat key
exchange in SSH-2 (see section 4.18.2) or due to keepalives (section
4.14.1).
This means that the operating system rejected the parameters of the
network connection PuTTY tried to make, usually without actually
trying to connect to anything, because they were simply invalid.
This FAQ is published on the PuTTY web site, and also provided as an
appendix in the manual.
A.1 Introduction
PuTTY is a client program for the SSH, Telnet, Rlogin, and SUPDUP
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.
Yes. SSH-2 support has been available in PuTTY since version 0.50 in
2000.
Public key authentication (both RSA and DSA) in SSH-2 was new in
version 0.52 in 2002.
A.2.2 Does PuTTY support reading OpenSSH or ssh.com SSH-2 private key
files?
PuTTY doesn't support this natively (see the wishlist entry for
reasons why not), but as of 0.53 PuTTYgen can convert both OpenSSH
and ssh.com private key files into PuTTY's format.
In version 0.51 and before, local echo could not be separated from
local line editing (where you type a line of text locally, and it
is not sent to the server until you press Return, so you have the
chance to edit it and correct mistakes _before_ the server sees it).
New in version 0.52, local echo and local line editing are separate
options, and by default PuTTY will try to determine automatically
whether to enable them or not, based on which protocol you have
selected and also based on hints from the server. If you have a
problem with PuTTY's default choice, you can force each option to be
enabled or disabled as you choose. The controls are in the Terminal
panel, in the section marked `Line discipline options'.
A.2.5 Does PuTTY support storing settings, so I don't have to change them
every time?
A.2.8 Does PuTTY have the ability to remember my password so I don't have
to type it every time?
No, it doesn't.
A.2.9 Is there an option to turn off the annoying host key prompts?
No, there isn't. And there won't be. Even if you write it yourself
and send us the patch, we won't accept it.
Those annoying host key prompts are the _whole point_ of SSH.
Without them, all the cryptographic technology SSH uses to secure
your session is doing nothing more than making an attacker's job
slightly harder; instead of sitting between you and the server with
a packet sniffer, the attacker must actually subvert a router and
start modifying the packets going back and forth. But that's not all
that much harder than just sniffing; and without host key checking,
it will go completely undetected by client or server.
Host key checking is your guarantee that the encryption you put
on your data at the client end is the _same_ encryption taken off
the data at the server end; it's your guarantee that it hasn't
been removed and replaced somewhere on the way. Host key checking
makes the attacker's job _astronomically_ hard, compared to packet
sniffing, and even compared to subverting a router. Instead of
applying a little intelligence and keeping an eye on oss-security,
the attacker must now perform a brute-force attack against at least
one military-strength cipher. That insignificant host key prompt
really does make _that_ much difference.
A.2.10 Will you write an SSH server for the PuTTY suite, to go with the
client?
While much of the protocol and networking code can be made common
between a client and server, to make a _useful_ general-purpose
server requires all sorts of fiddly new code like interacting with
OS authentication databases and the like.
Unfortunately not.
(We used to also provide executables for Windows for the Alpha
processor, but stopped after 0.58 due to lack of interest.)
There are Unix ports of most of the traditional PuTTY tools, and
also one entirely new application.
- Unix ports of PuTTY, Plink, PSCP, and PSFTP, which work pretty
much the same as their Windows counterparts;
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.
However, if you're a Unix user and you can see no reason to switch
from OpenSSH to PuTTY/Plink, then you're probably right. We don't
expect our Unix port to be the right thing for everybody.
We once did some work on such a port, but it only reached an early
stage, and certainly not a useful one. It's no longer being actively
worked on.
We hope so!
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.
I hope so, but given that ports aren't really progressing very fast
even on systems the developers _do_ already know how to program for,
it might be a long time before any of us get round to learning a new
system and doing the port for that.
However, some of the work has been done by other people; see the
Links page of our website for various third-party ports.
No, it isn't. None of the PuTTY team uses Visual Basic, and none of
us has any particular need to make SSH connections from a Visual
Basic application. In addition, all the preliminary work to turn it
into a DLL would be necessary first; and furthermore, we don't even
know how to write VB components.
A.4.3 How can I use PuTTY to make an SSH connection from within another
program?
On Windows, PuTTY stores most of its data (saved sessions, SSH host
keys) in the Registry. The precise location is
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY
and within that area, saved sessions are stored under `Sessions'
while host keys are stored under `SshHostKeys'.
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\RandSeedFile
You can ask PuTTY to delete all this data; see question A.8.2.
A.5.3 Why do small PuTTY icons appear next to the login prompts?
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.)
This lets you tell the difference between (for example) a legitimate
prompt in which PuTTY itself asks you for your private key
passphrase, and a fake prompt in which the server tries to send
the identical text to trick you into telling _it_ your private key
passphrase.
A.5.4 Why has Plink started saying `Press Return to begin session'?
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.
If you know the name of the computer you want to connect to, but
don't know what login name or password to use, you should talk to
whoever administers that computer. If you don't know who that is,
see the next question for some possible ways to find out.
Again, this is not a question you should be asking _us_. You need
to read the manuals, or ask the administrator, of _the computer you
have connected to_.
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.
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?
Copy and paste works similarly to the X Window System. You use the
left mouse button to select text in the PuTTY window. The act of
selection _automatically_ copies the text to the clipboard: there
is no need to press Ctrl-Ins or Ctrl-C or anything else. In fact,
pressing Ctrl-C will send a Ctrl-C character to the other end of
your connection (just like it does the rest of the time), which may
have unpleasant effects. The _only_ thing you need to do, to copy
text to the clipboard, is to select it.
A.6.7 How do I use all PuTTY's features (public keys, proxying, cipher
selection, etc.) in PSCP, PSFTP and Plink?
Most major features (e.g., public keys, port forwarding) are
available through command line options. See section 3.11.3.
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.9 How do I use PSCP to copy a file whose name has spaces in?
If PSCP is using the newer SFTP protocol (which is usual with most
modern servers), this is straightforward; all filenames with spaces
in are specified using a single pair of quotes in the obvious way:
However, if PSCP is using the older SCP protocol for some reason,
things are more confusing. If you're specifying a file at the local
end, you just use one set of quotes as you would normally do:
If you're not sure, the 32-bit version is generally the safe option.
It will run perfectly well on all processors and on all versions of
Windows that PuTTY supports. PuTTY doesn't require to run as a 64-
bit application to work well, and having a 32-bit PuTTY on a 64-bit
system isn't likely to cause you any trouble.
The 64-bit version (first released in 0.68) will only run if you
have a 64-bit processor _and_ a 64-bit edition of Windows (both of
these things are likely to be true of any recent Windows PC). It
will run somewhat faster (in particular, the cryptography will be
faster, especially during link setup), but it will consume slightly
more memory.
A.7 Troubleshooting
This happens because PSCP was expecting to see data from the server
that was part of the PSCP protocol exchange, and instead it saw data
that it couldn't make any sense of at all.
A.7.2 I clicked on a colour in the Colours panel, and the colour didn't
change in my terminal.
If this happens just while the connection is starting up, this often
indicates that for some reason the client and server have failed to
establish a session encryption key. Somehow, they have performed
calculations that should have given each of them the same key, but
have ended up with different keys; so data encrypted by one and
decrypted by the other looks like random garbage.
A.7.4 When attempting a file transfer, either PSCP or PSFTP says `Out of
memory' and dies.
On Unix, a simple fix is to ensure that all the parts of your login
script that might generate output are in `.profile' (if you use a
Bourne shell derivative) or `.login' (if you use a C shell). Putting
them in more general files such as `.bashrc' or `.cshrc' is liable
to lead to problems.
The throughput of PSFTP 0.54 should be much better than 0.53b and
prior; we've added code to the SFTP backend to queue several blocks
of data rather than waiting for an acknowledgement for each. (The
SCP backend did not suffer from this performance issue because SCP
is a much simpler protocol.)
A.7.8 My PuTTY sessions unexpectedly close after they are idle for a
while.
Some types of firewall, and almost any router doing Network Address
Translation (NAT, also known as IP masquerading), will forget about
a connection through them if the connection does nothing for too
long. This will cause the connection to be rudely cut off when
contact is resumed.
A.7.9 PuTTY's network connections time out too quickly when network
connectivity is temporarily lost.
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\
MSTCP\MaxDataRetries
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\
Parameters\TcpMaxDataRetransmissions
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.12 My keyboard stops working once PuTTY displays the password prompt.
No, it doesn't. PuTTY just doesn't display the password you type, so
that someone looking at your screen can't see what it is.
Unlike the Windows login prompts, PuTTY doesn't display the password
as a row of asterisks either. This is so that someone looking at
your screen can't even tell how _long_ your password is, which might
be valuable information.
You should still read the Feedback page on the PuTTY website (also
provided as appendix B in the manual), and follow the guidelines
contained in that.
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.
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).
If you really want to change the character set used by the server,
the right place is `/etc/sysconfig/i18n', but this shouldn't be
necessary.
A.7.16 Since I upgraded to PuTTY 0.54, the scrollback has stopped working
when I run `screen'.
PuTTY's terminal emulator has always had the policy that when the
`alternate screen' is in use, nothing is added to the scrollback.
This is because the usual sorts of programs which use the alternate
screen are things like text editors, which tend to scroll back and
forth in the same document a lot; so (a) they would fill up the
scrollback with a large amount of unhelpfully disordered text, and
(b) they contain their _own_ method for the user to scroll back to
the bit they were interested in. We have generally found this policy
to do the Right Thing in almost all situations.
(_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.)
psftp> pwd
Remote directory is /dir1/dir2
psftp> get filename.ext
/dir1/dir2filename.ext: no such file or directory
There is a patch for OpenSSH attached to that bug; it's also fixed
in recent versions of portable OpenSSH (from around 3.8).
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.18), 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'.
The SSH protocol recently gained a new `terminal mode', IUTF8, which
PuTTY sends by default; see section 4.24.2. This is the first new
terminal mode since the SSH-2 protocol was defined. While servers
are supposed to ignore modes they don't know about, some buggy
servers will unceremoniously close the connection if they see
anything they don't recognise. SSH servers in embedded devices,
network appliances, and the like seem to disproportionately have
this bug.
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.7.24 Since 0.78, I can't find where to configure my SSH private key.
(This control had previously been on the `Auth' panel since public
key authentication was first released in 2002, so many online how-
to guides still describe it there. The configuration controls were
reorganised to make room for features added in 0.78, such as OpenSSH
certificates.)
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.
A.8.2 What does PuTTY leave on a system? How can I clean up after it?
PuTTY will leave some Registry entries, and a random seed file, on
the PC (see question A.5.2). Windows 7 and up also remember some
information about recently launched sessions for the `jump list'
feature.
If you are using PuTTY on a public PC, or somebody else's PC, you
might want to clean this information up when you leave. You can do
that automatically, by running the command `putty -cleanup'. See
section 3.11.2 in the documentation for more detail. (Note that this
only removes settings for the currently logged-in user on multi-user
systems.)
A.8.3 How come PuTTY now supports DSA, when the website used to say how
insecure it was?
DSA has a major weakness _if badly implemented_: it relies on a
random number generator to far too great an extent. If the random
number generator produces a number an attacker can predict, the DSA
private key is exposed - meaning that the attacker can log in as you
on all systems that accept that key.
There have been other copies of PuTTY on the store, some looking
quite similar, and some charging money. Those were uploaded by other
people, and we can't guarantee anything about them.
The first version we published to the Microsoft Store was 0.76 (some
time after its initial release on our website).
The real PuTTY web site, run by the PuTTY team, has always been at
https://www.chiark.greenend.org.uk/~sgtatham/putty/.
No, thank you. Even if you can find one (most of them seem to
have been registered already, by people who didn't ask whether we
actually wanted it before they applied), we're happy with the PuTTY
web site being exactly where it is. It's not hard to find (just type
`putty' into google.com and we're the first link returned), and we
don't believe the administrative hassle of moving the site would be
worth the benefit.
A.9.3 Would you like free web hosting for the PuTTY web site?
A.9.4 Would you link to my web site from the PuTTY web site?
One very nice effect of the Google ranking mechanism is that by and
large, the most popular web sites get the highest rankings. This
means that when an ordinary person does a search, the top item in
the search is very likely to be a high-quality site or the site they
actually wanted, rather than the site which paid the most money for
its ranking.
The PuTTY web site is held in high esteem by Google, for precisely
this reason: lots of people have linked to it simply because they
like PuTTY, without us ever having to ask anyone to link to us. We
feel that it would be an abuse of this esteem to use it to boost the
ranking of random advertisers' web sites. If you want your web site
to have a high Google ranking, we'd prefer that you achieve this the
way we did - by being good enough at what you do that people will
link to you simply because they like you.
Partly, because we don't want to move the web site location (see
question A.9.2).
Because you're not a member of the PuTTY core development team. The
putty-bugs mailing list is not a general newsgroup-like discussion
forum; it's a contact address for the core developers, and an
_internal_ mailing list for us to discuss things among ourselves.
If we opened it up for everybody to subscribe to, it would turn
into something more like a newsgroup and we would be completely
overwhelmed by the volume of traffic. It's hard enough to keep up
with the list as it is.
Please, _please_ don't feel you have to. PuTTY is completely free
software, and not shareware. We think it's very important that
_everybody_ who wants to use PuTTY should be able to, whether they
have any money or not; so the last thing we would want is for a
PuTTY user to feel guilty because they haven't paid us any money. If
you want to keep your money, please do keep it. We wouldn't dream of
asking for any.
Having said all that, if you still really _want_ to give us money,
we won't argue :-) The easiest way for us to accept donations is if
you send money to <[email protected]> using PayPal (www.paypal.com).
If you don't like PayPal, talk to us; we can probably arrange some
alternative means.
Yes. For most things, you need not bother asking us explicitly for
permission; our licence already grants you permission.
No!
The second, much more important, reason is that PuTTY users _don't_
pay us. The PuTTY team does not have an income; it's a volunteer
effort composed of people spending their spare time to try to write
useful software. We aren't even a company or any kind of legally
recognised organisation. We're just a bunch of people who happen to
do some stuff in our spare time.
If your form contains any clause along the lines of `the undersigned
represents and warrants', we're not going to sign it. This is
particularly true if it asks us to warrant that PuTTY is secure;
see question A.9.10 for more discussion of this. But it doesn't
really matter what we're supposed to be warranting: even if it's
something we already believe is true, such as that we don't infringe
any third-party copyright, we will not sign a document accepting
any legal or financial liability. This is simply because the PuTTY
development project has no income out of which to satisfy that
liability, or pay legal costs, should it become necessary. We cannot
afford to be sued. We are assuring you that _we have done our best_;
if that isn't good enough for you, tough.
See also question A.9.13 for another reason why we don't want to do
this sort of thing.
See also question A.9.13 for another reason why we don't want to do
this sort of thing.
A.9.14 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.16 As one of our existing software vendors, can you just fill in this
questionnaire for us?
But we are a team of free software developers, and that means your
relationship with us is nothing like that at all. If you once
downloaded our software from our website, that's great and we hope
you found it useful, but it doesn't mean we have the least idea who
you are, or any incentive to do lots of unpaid work to support our
`relationship' with you.
People report this every so often, and usually the reason turns out
to be that they've matched up the wrong checksums file with the
wrong binaries.
The PuTTY download page contains more than one version of the
software. There's a _latest release_ version; there are the
_development snapshots_; and when we're in the run-up to making a
release, there are also _pre-release_ builds of the upcoming new
version. Each one has its own collection of binaries, and its own
collection of checksums files to go with them.
If you have double-checked all that, and you still think there's
a real mismatch, then please send us a report carefully quoting
everything relevant:
You're looking at the wrong web site; the only PuTTY we know about
here is the name of a computer program.
If you want the kind of putty you can buy as an executive toy, the
PuTTY team can personally recommend Thinking Putty, which you can
buy from Crazy Aaron's Putty World, at www.puttyworld.com.
A.10.3 What does `PuTTY' mean?
It's the name of a popular SSH and Telnet client. Any other meaning
is in the eye of the beholder. It's been rumoured that `PuTTY' is
the antonym of `getty', or that it's the stuff that makes your
Windows useful, or that it's a kind of plutonium Teletype. We
couldn't possibly comment on such allegations.
Section B.1 gives some general guidelines for sending any kind of e-
mail to the development team. Following sections give more specific
guidelines for particular types of e-mail, such as bug reports and
feature requests.
The PuTTY development team gets a _lot_ of mail. If you can possibly
solve your own problem by reading the manual, reading the FAQ,
reading the web site, asking a fellow user, perhaps posting to a
newsgroup (see section B.1.2), or some other means, then it would
make our lives much easier.
If you are considering sending any kind of large data file to the
PuTTY team, it's almost always a bad idea, or at the very least it
would be better to ask us first whether we actually need the file.
Alternatively, you could put the file on a web site and just send us
the URL; that way, we don't have to download it unless we decide we
actually need it, and only one of us needs to download it instead of
it being automatically copied to all the developers.
If you _must_ mail a screen shot, don't send it as a .BMP file. BMPs
have no compression and they are _much_ larger than other image
formats such as PNG, TIFF and GIF. Convert the file to a properly
compressed image format before sending it.
Please don't mail us executables, at all. Our mail server blocks all
incoming e-mail containing executables, as a defence against the
vast numbers of e-mail viruses we receive every day. If you mail us
an executable, it will just bounce.
If you don't have direct access to Usenet, you can access these
newsgroups through Google Groups (groups.google.com).
If you think you have found a bug in PuTTY, your first steps should
be:
- Check the Change Log on the PuTTY website, and see if we have
already fixed the bug in the development snapshots.
If none of those options solved your problem, and you still need
to report a bug to us, it is useful if you include some general
information:
- Tell us what kind of server you are connecting to; what OS, and
if possible what SSH server (if you're using SSH). You can get
some of this information from the PuTTY Event Log (see section
3.1.3.1 in the manual).
- Send us the contents of the PuTTY Event Log, unless you have a
specific reason not to (for example, if it contains confidential
information that you think we should be able to solve your
problem without needing to know).
- Don't just tell us that PuTTY `does the wrong thing'; tell us
exactly and precisely what it did, and also tell us exactly
and precisely what you think it should have done instead. Some
people tell us PuTTY does the wrong thing, and it turns out that
it was doing the right thing and their expectations were wrong.
Help to avoid this problem by telling us exactly what you think
it should have done, and exactly what it did do.
- https://www.chiark.greenend.org.uk/~sgtatham/bugs.html is an
article on how to report bugs effectively in general. If your
bug report is _particularly_ unclear, we may ask you to go away,
read this article, and then report the bug again.
For this purpose, we provide a GPG key suitable for encryption: the
Secure Contact Key. See section F.1 for details of this.
If you want to request a new feature in PuTTY, the very first things
you should do are:
- Check the Wishlist page on the PuTTY website, and see if your
feature is already on the list. If it is, it probably won't
achieve very much to repeat the request. (But see section B.5 if
you want to persuade us to give your particular feature higher
priority.)
- Check the Wishlist and Change Log on the PuTTY website, and
see if we have already added your feature in the development
snapshots. If it isn't clear, download the latest development
snapshot and see if the feature is present. If it is, then it
will also be in the next release and there is no need to mail us
at all.
- 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 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.
If the PuTTY web site is down (Connection Timed Out), please don't
bother mailing us to tell us about it. Most of us read our e-mail on
the same machines that host the web site, so if those machines are
down then we will notice _before_ we read our e-mail. So there's no
point telling us our servers are down.
Of course, if the web site has some other error (Connection Refused,
404 Not Found, 403 Forbidden, or something else) then we might _not_
have noticed and it might still be worth telling us about it.
If you want to report a problem with our web site, check that you're
looking at our _real_ web site and not a mirror. The real web site
is at `https://www.chiark.greenend.org.uk/~sgtatham/putty/'; if
that's not where you're reading this, then don't report the problem
to us until you've checked that it's really a problem with the
main site. If it's only a problem with the mirror, you should try
to contact the administrator of that mirror site first, and only
contact us if that doesn't solve the problem (in case we need to
remove the mirror from our list).
(If you want to distribute PuTTY alongside your own application for
use with that application, or if you want to distribute PuTTY within
your own organisation, then we recommend, but do not insist, that
you offer your own first-line technical support, to answer questions
about the interaction of PuTTY with your environment. If your users
mail us directly, we won't be able to tell them anything useful
about your specific setup.)
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!)
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.
C.1 Overview
A PPK file stores a private key, and the corresponding public key.
Both are contained in the same file.
When the key file is encrypted, the encryption key is derived from a
passphrase. An encrypted PPK file is also tamper-proofed using a MAC
(authentication code), also derived from the same passphrase. The
MAC protects the encrypted private key data, but it also covers the
cleartext parts of the file. So you can't edit the public half of
the key without invalidating the MAC and causing the key file as a
whole to become useless.
This MAC protects the key file against active cryptographic attacks
in which the public half of a key pair is modified in a controlled
way that allows an attacker to deduce information about the private
half from the resulting corrupted signatures. Any attempt to do
that to a PPK file should be reliably caught by the MAC failing to
validate.
(Such an attack would only be useful if the key file was stored in a
location where the attacker could modify it without also having full
access to the process that you type passphrases into. But that's not
impossible; for example, if your home directory was on a network
file server, then the file server's administrator could access the
key file but not processes on the client machine.)
The MAC also covers the _comment_ on the key. This stops an attacker
from swapping keys with each other and editing the comments to
disguise the fact. As a consequence, PuTTYgen cannot edit the
comment on a key unless you decrypt the key with your passphrase
first.
The outer layer of a PPK file is text-based. The PuTTY tools will
always use LF line termination when writing PPK files, but will
tolerate CR+LF and CR-only on input.
The first few lines identify it as a PPK, and give some initial data
about what's stored in it and how. They look like this:
PuTTY-User-Key-File-version: algorithm-name
Encryption: encryption-type
Comment: key-comment-string
The next part of the file gives the public key. This is stored
unencrypted but base64-encoded (RFC 4648), and is preceded by a
header line saying how many lines of base64 data are shown, looking
like this:
Public-Lines: number-of-lines
that many lines of base64 data
Key-Derivation: argon2-flavour
Argon2-Memory: decimal-integer
Argon2-Passes: decimal-integer
Argon2-Parallelism: decimal-integer
Argon2-Salt: hex-string
The three integer values are used as parameters for Argon2, which
allows you to configure the amount of memory used (in Kbyte), the
number of passes of the algorithm to run (to tune its running time),
and the degree of parallelism required by the hash function. The
salt is decoded into a sequence of binary bytes and used as an
additional input to Argon2. (It is chosen randomly when the key file
is written, so that a guessing attack can't be mounted in parallel
against multiple key files.)
The next part of the file gives the private key. This is base64-
encoded in the same way:
Private-Lines: number-of-lines
that many lines of base64 data
Private-MAC: hex-mac-data
*hex-mac-data* is a hexadecimal-encoded value, 64 digits long (i.e.
32 bytes), generated using the HMAC-SHA-256 algorithm with the
following binary data as input:
- string: the binary public key data, as decoded from the base64
lines after the `Public-Lines' header.
The MAC key is derived from the passphrase: see section C.4.
This section describes the private key format for each key type
supported by PuTTY.
Because the PPK format also contains the public key (and both public
and private key are protected by the same MAC to ensure they can't
be made inconsistent), there is no need for the private key section
of the file to repeat data from the public section. So some of these
formats are very short.
C.3.1 RSA
The public key data has already provided the key modulus and the
public encoding exponent. The private data stores:
- mpint: the other prime factor _q_ of the key. (RSA keys stored
in this format are expected to have exactly two prime factors.)
C.3.2 DSA
- `ecdsa-sha2-nistp256'
- `ecdsa-sha2-nistp384'
- `ecdsa-sha2-nistp521'
The public key data has already provided the public elliptic curve
point. The private key stores:
- `ssh-ed25519'
- `ssh-ed448'
The public key data has already provided the public elliptic curve
point. The private key stores:
When a key file is encrypted, there are three pieces of key material
that need to be computed from the passphrase:
- the key for the symmetric cipher used to encrypt the private key
(If the key is unencrypted, then all those headers are omitted, and
Argon2 is not run at all.)
C.5.1 Version 2
In PPK version 2, the MAC algorithm used was HMAC-SHA-1 (so the
Private-MAC line contained only 40 hex digits).
The MAC key was 20 bytes long, and was a single SHA-1 hash of the
following data:
- the passphrase, without any prefix length field. (If the key is
stored unencrypted, the passphrase was taken to be the empty
string for these purposes.)
C.5.2 Version 1
PPK version 1 was a badly designed format, only used during initial
development, and not recommended for production use.
In PPK version 1, the input to the MAC does not include any of the
header fields or the public key. It is simply the private key data
(still in plaintext and including random padding), all by itself
(without a wrapping string).
PPK version 1 only supported the RSA and DSA key types. For RSA,
this validation can be done using only the provided data (since the
private key blob contains enough information to reconstruct the
public values anyway). But for DSA, that isn't quite enough.
Hence, PPK version 1 DSA keys extended the private data so that
immediately after _x_ was stored an extra value:
The idea was that checking this hash would verify that the key
parameters had not been tampered with, and then the loading
application could directly verify that _g_^_x_ = _y_.
The exceptions to that rule are due to the need for Visual Studio
compatibility:
- You can assume `int' is _at least_ 32 bits wide. (We've never
tried to port PuTTY to a platform with 16-bit int, and it
doesn't look likely to be necessary in future.)
- You can assume that using `memset' to write zero bytes over a
whole structure will have the effect of setting all its pointer
fields to NULL. (The standard itself guarantees this for
_integer_ fields, but not for pointers.)
- You can assume that `time_t' has POSIX semantics, i.e. that
it represents an integer number of non-leap seconds since
1970-01-01 00:00:00 UTC. (Times in this format are used in
X authorisation, but we could work around that by carefully
distinguishing local `time_t' from time values used in the wire
protocol; but these semantics of `time_t' are also baked into
the shared library API used by the GSSAPI authentication code,
which would be much harder to change.)
- From past experience with MacOS, we're still a bit nervous about
'\n' and '\r' potentially having unusual meanings on a given
platform. So it's fine to say `\n' in a string you're passing to
`printf', but in any context where those characters appear in a
standardised wire protocol or a binary file format, they should
be spelled '\012' and '\015' respectively.
PuTTY is not an SSH client with some other stuff tacked on the side.
PuTTY is a generic, multiple-backend, remote VT-terminal client
which happens to support one backend which is larger, more popular
and more useful than the rest. Any extra feature which can possibly
be general across all backends should be so: localising features
unnecessarily into the SSH back end is a design error. (For example,
we had several code submissions for proxy support which worked by
hacking ssh.c. Clearly this is completely wrong: the network.h
abstraction is the place to put it, so that it will apply to all
back ends equally, and indeed we eventually put it there after
another contributor sent a better patch.)
We have made _some_ effort to make it easy to compile our code using
a C++ compiler: notably, our `snew', `snewn' and `sresize' macros
explicitly cast the return values of malloc and realloc to the
target type. (This has type checking advantages even in C: it means
you never accidentally allocate the wrong size piece of memory for
the pointer type you're assigning it to. C++ friendliness is really
a side benefit.)
The one exception: a port to a new platform may use languages other
than C if they are necessary to code on that platform. If your
favourite PDA has a GUI with a C++ API, then there's no way you can
do a port of PuTTY without using C++, so go ahead and use it. But
keep the C++ restricted to that platform's subdirectory; if your
changes force the Unix or Windows ports to be compiled as C++, they
will be unacceptable to us.
We want to keep both these properties - the small size, and the ease
of installation - if at all possible. So code contributions that
depend critically on external DLLs, or that add a huge amount to the
code size for a feature which is only useful to a small minority of
users, are likely to be thrown out immediately.
Also, the front ends can use multiple threads if they like. For
example, the Windows front-end code spawns subthreads to deal with
bidirectional blocking I/O on non-network streams such as Windows
pipes. However, it keeps tight control of its auxiliary threads, and
uses them only for that one purpose, as a form of select(). Pretty
much all the code outside windows/handle-io.c is _only_ ever called
from the one primary thread; the others just loop round blocking
on file handles, and signal the main thread (via Windows event
objects) when some real work needs doing. This is not considered a
portability hazard because that code is already Windows-specific and
needs rewriting on other platforms.
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.
The PuTTY code base has a standard idiom for doing this in C, as
follows.
Firstly, we define two struct types for our trait. One of them
describes a particular _kind_ of implementation of that trait,
and it's full of (mostly) function pointers. The other describes
a specific _instance_ of an implementation of that trait, and it
will contain a pointer to a const instance of the first type. For
example:
struct MyAbstractionVtable {
MyAbstraction *(*new)(const MyAbstractionVtable *vt);
void (*free)(MyAbstraction *);
void (*modify)(MyAbstraction *, unsigned some_parameter);
unsigned (*query)(MyAbstraction *, unsigned some_parameter);
};
struct MyAbstraction {
const MyAbstractionVtable *vt;
};
(In most cases, the vtable structure has a name ending in `vtable'.
But for historical reasons a lot of the crypto primitives that
use this scheme - ciphers, hash functions, public key methods and
so on - instead have names ending in `alg', on the basis that the
primitives they implement are often referred to as `encryption
algorithms', `hash algorithms' and so forth.)
struct MyImplementation {
unsigned internal_data[16];
SomeOtherType *dynamic_subthing;
MyAbstraction myabs;
};
_In principle_, this is all you need. Client code can construct a
new instance of a particular implementation of MyAbstraction by
digging out the new method from the vtable and calling it (with
the vtable itself as a parameter), which returns a MyAbstraction *
pointer that identifies a newly created instance, in which the vt
field will contain a pointer to the same vtable structure you passed
in. And once you have an instance object, say MyAbstraction *myabs,
you can dig out one of the other method pointers from the vtable it
points to, and call that, passing the object itself as a parameter.
And now call sites can use those reasonably clean-looking wrapper
functions, and shouldn't ever have to directly refer to the vt field
inside any myabs object they're holding. For example, you might
write something like this:
and then all this code can use a different implementation of the
same abstraction by just changing which vtable pointer it passed in
in the first line.
- Unlike in C++, all objects in PuTTY that use this system are
dynamically allocated. The `constructor' functions (whether
they're virtualised across the whole abstraction or specific to
each implementation) always allocate memory and return a pointer
to it. The `free' method (our analogue of a destructor) always
expects the input pointer to be dynamically allocated, and frees
it. As a result, client code doesn't need to know how large
the implementing object type is, because it will never need to
allocate it (on the stack or anywhere else).
The effect of all of this is that you can make other pieces of
code able to use any instance of one of these types, by passing
it an actual vtable as a parameter. For example, the hash_simple
function takes an ssh_hashalg vtable pointer specifying any
hash algorithm you like, and internally, it creates an object
of that type, uses it, and frees it. In C++, you'd probably
do this using a template, which would mean you had multiple
specialisations of hash_simple - and then it would be much more
difficult to decide _at run time_ which one you needed to use.
Here, hash_simple is still just one function, and you can decide
as late as you like which vtable to pass to it.
The current PuTTY code probably does not conform strictly to _all_
of the principles listed above. There may be the occasional SSH-
specific piece of code in what should be a backend-independent
module, or the occasional dependence on a non-standard X library
function under Unix.
This should not be taken as a licence to go ahead and violate the
rules. Where we violate them ourselves, we're not happy about it,
and we would welcome patches that fix any existing problems. Please
try to help us make our code better, not worse!
We create GPG signatures for all the PuTTY files distributed from
our web site, so that users can be confident that the files have not
been tampered with. Here we identify our public keys, and explain
our signature policy so you can have an accurate idea of what each
signature guarantees. This description is provided as both a web
page on the PuTTY site, and an appendix in the PuTTY manual.
(Note that none of the keys, signatures, etc mentioned here have
anything to do with keys used with SSH - they are purely for
verifying the origin of files distributed by the PuTTY team.)
Snapshot Key
Release Key
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 current issue of those keys are available for download from the
PuTTY website, and are also available on PGP keyservers using the
key IDs listed below.
- People tampering with the PuTTY binaries between the PuTTY web
site and you.
- People tampering with the build machines so that the next set of
binaries they build will be malicious in some way.
- People stealing the unencrypted private key from the build
machine it lives on.
The Master Key signs almost nothing. Its purpose is to bind the
other keys together and certify that they are all owned by the same
people and part of the same integrated setup. The only signatures
produced by the Master Key, _ever_, should be the signatures on the
other keys.
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.
Each release is signed with the Release Key that was current at the
time of release. We don't go back and re-sign old releases with
newly generated keys.
The details of all previous keys are given here.
If the agent holds any keys with an encrypted form (or no keys
at all), returns SSH_AGENT_SUCCESS to indicate that no such keys
are now held in cleartext form, followed by a uint32 specifying
how many keys remain in cleartext form (because the agent didn't
hold an encrypted form for them). If the agent holds nothing but
keys in cleartext form, returns SSH_AGENT_EXTENSION_FAILURE.
Bit 0
H.1 Requirements
*Be able to pass prompts on to the user.* On the other hand, some
userauth methods can be only _partially_ automated; some of the
server's prompts might still require human input. Also, the plugin
automating the authentication might need to ask its own questions
that are not provided by the SSH server. (For example, `please
enter the master key that the real response will be generated by
hashing'.) So after the plugin intercepts the server's questions, it
needs to be able to ask its own questions of the user, which may or
may not be the same questions sent by the server.
This protocol borrows the low-level data formatting from SSH itself,
in particular the following wire encodings from [RFC4251] section 5:
*byte*
*boolean*
*uint32*
Unlike SSH itself, the protocol spoken between the client and the
plugin is unencrypted, because local inter-process pipes are assumed
to be secured by the OS kernel. So the binary packet protocol is
much simpler than SSH proper, and is similar to SFTP and the OpenSSH
agent protocol.
The client begins trying to authenticate with the SSH server in the
usual way, using the username provided by the plugin (if any) or
alternatively one obtained via its normal (non-plugin) policy.
The plugin's standard input will close when the client no longer
requires the plugin's services, for any reason. This could be
because authentication is complete (with overall success or overall
failure), or because the user has manually aborted the session in
mid-authentication, or because the client crashed.
As described in section H.3, every message starts with the same two
fields:
The length field does not include itself, but does include the type
code.
#define PLUGIN_INIT 1
#define PLUGIN_INIT_RESPONSE 2
#define PLUGIN_PROTOCOL 3
#define PLUGIN_PROTOCOL_ACCEPT 4
#define PLUGIN_PROTOCOL_REJECT 5
#define PLUGIN_AUTH_SUCCESS 6
#define PLUGIN_AUTH_FAILURE 7
#define PLUGIN_INIT_FAILURE 8
#define PLUGIN_KI_SERVER_REQUEST 20
#define PLUGIN_KI_SERVER_RESPONSE 21
#define PLUGIN_KI_USER_REQUEST 22
#define PLUGIN_KI_USER_RESPONSE 23
H.6.1 PLUGIN_INIT
- *string*: the username that the client will use to log in, if
the plugin chooses not to override it. An empty string means
that the client has no opinion about this (and might, for
example, prompt the user).
H.6.2 PLUGIN_INIT_RESPONSE
- *string*: the username that the plugin suggests the client use.
An empty string means that the plugin has no opinion and the
client should stick with the username it already had (or prompt
the user, if it had none).
H.6.3 PLUGIN_INIT_FAILURE
H.6.4 PLUGIN_PROTOCOL
H.6.5 PLUGIN_PROTOCOL_REJECT
H.6.6 PLUGIN_PROTOCOL_ACCEPT
*What happens next*: depends on the auth protocol agreed on. For
keyboard-interactive, the client will send PLUGIN_KI_SERVER_REQUEST
or PLUGIN_AUTH_SUCCESS or PLUGIN_AUTH_FAILURE. No other method is
specified.
H.6.7 PLUGIN_KI_SERVER_REQUEST
*Message contents after the type code*: the exact contents of the
SSH_MSG_USERAUTH_INFO_REQUEST just sent by the server. See [RFC4256]
section 3.2 for details. The summary:
H.6.8 PLUGIN_KI_SERVER_RESPONSE
*Message contents after the type code*: the exact contents of the
SSH_MSG_USERAUTH_INFO_RESPONSE that the client should send back to
the server. See [RFC4256] section 3.4 for details. The summary:
H.6.9 PLUGIN_KI_USER_REQUEST
H.6.10 PLUGIN_KI_USER_RESPONSE
H.6.12 PLUGIN_AUTH_FAILURE
H.7 References