A lot of Internet protocols are composed of commands and responses in plain text. For example, SMTP (the protocol used to transfer e-mail), NNTP (the protocol used to transfer Usenet news), and HTTP (the protocol used to serve Web pages) all consist of commands in readable plain text.
Sometimes it can be useful to connect directly to one of these services and speak the protocol ‘by hand’, by typing protocol commands and watching the responses. On Unix machines, you can do this using the system's telnet command to connect to the right port number. For example, telnet mailserver.example.com 25 might enable you to talk directly to the SMTP service running on a mail server.
Although the Unix telnet program provides this functionality, the protocol being used is not really Telnet. Really there is no actual protocol at all; the bytes sent down the connection are exactly the ones you type, and the bytes shown on the screen are exactly the ones sent by the server. Unix telnet will attempt to detect or guess whether the service it is talking to is a real Telnet service or not; PuTTY prefers to be told for certain.
In order to make a debugging connection to a service of this type, you simply select the fourth protocol name, ‘Raw’, from the ‘Protocol’ buttons in the ‘Session’ configuration panel. (See
section 4.1.1
.) You can then enter a host name and a port number, and
make the connection.
3.7 Connecting to a local serial line
PuTTY can connect directly to a local serial line as an alternative to making a network connection. In this mode, text typed into the PuTTY window will be sent straight out of your computer's serial port, and data received through that port will be displayed in the PuTTY window. You might use this mode, for example, if your serial port is connected to another computer which has a serial connection.
To make a connection of this type, simply select ‘Serial’ from the ‘Connection type’ radio buttons on the ‘Session’ configuration panel (see
section 4.1.1
). The ‘Host Name’ and ‘Port’ boxes will transform into ‘Serial line’ and ‘Speed’, allowing you to specify
which serial line to use (if your computer has more than one) and what speed (baud rate) to use when transferring data. For further configuration options (data bits, stop bits, parity, flow control), you can use the ‘Serial’ configuration panel (see
section 4.27
).
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.
3.8 The PuTTY command line
PuTTY can be made to do various things without user intervention by supplying command-line arguments (e.g., from a command prompt window, or a Windows shortcut).
•
3.8.1 Starting a session from the command line
•
3.8.2 -cleanup
•
3.8.3 Standard command-line options
o
3.8.3.1 -load: load a saved session
o
3.8.3.2 Selecting a protocol: -ssh, -telnet, -rlogin, -raw -serial
o
3.8.3.3 -v: increase verbosity
o
3.8.3.4 -l: specify a login name
o
3.8.3.5 -L, -R and -D: set up port forwardings
o
3.8.3.6 -m: read a remote command or script from a file
o
3.8.3.7 -P: specify a port number
o
3.8.3.8 -pw: specify a password
o
3.8.3.9 -agent and -noagent: control use of Pageant for authentication
o
3.8.3.10 -A and -a: control agent forwarding
o
3.8.3.11 -X and -x: control X11 forwarding
o
3.8.3.12 -t and -T: control pseudo-terminal allocation
o
3.8.3.13 -N: suppress starting a shell or command