4.3BSD-UWisc/man/cat1/telnet.1c




TELNET(1C)          UNIX Programmer's Manual           TELNET(1C)



NAME
     telnet - user interface to the TELNET protocol

SYNOPSIS
     telnet [ host [ port ] ]

DESCRIPTION
     _T_e_l_n_e_t is used to communicate with another host using the
     TELNET protocol.  If _t_e_l_n_e_t is invoked without arguments, it
     enters command mode, indicated by its prompt ("telnet>").
     In this mode, it accepts and executes the commands listed
     below.  If it is invoked with arguments, it performs an open
     command (see below) with those arguments.

     Once a connection has been opened, _t_e_l_n_e_t enters an input
     mode.  The input mode entered will be either "character at a
     time" or "line by line" depending on what the remote system
     supports.

     In "character at a time" mode, most text typed is immedi-
     ately sent to the remote host for processing.

     In "line by line" mode, all text is echoed locally, and
     (normally) only completed lines are sent to the remote host.
     The "local echo character" (initially "^E") may be used to
     turn off and on the local echo (this would mostly be used to
     enter passwords without the password being echoed).

     In either mode, if the _l_o_c_a_l_c_h_a_r_s toggle is TRUE (the
     default in line mode; see below), the user's _q_u_i_t, _i_n_t_r, and
     _f_l_u_s_h characters are trapped locally, and sent as TELNET
     protocol sequences to the remote side.  There are options
     (see toggle _a_u_t_o_f_l_u_s_h and toggle _a_u_t_o_s_y_n_c_h below) which
     cause this action to flush subsequent output to the terminal
     (until the remote host acknowledges the TELNET sequence) and
     flush previous terminal input (in the case of _q_u_i_t and
     _i_n_t_r).

     While connected to a remote host, _t_e_l_n_e_t command mode may be
     entered by typing the _t_e_l_n_e_t "escape character" (initially
     "^]").  When in command mode, the normal terminal editing
     conventions are available.

     COMMANDS

     The following commands are available.  Only enough of each
     command to uniquely identify it need be typed (this is also
     true for arguments to the mode, set, toggle, and display
     commands).

     open _h_o_s_t [ _p_o_r_t ]
          Open a connection to the named host.  If no port number



Printed 12/27/86          May 10, 1986                          1






TELNET(1C)          UNIX Programmer's Manual           TELNET(1C)



          is specified, _t_e_l_n_e_t will attempt to contact a TELNET
          server at the default port.  The host specification may
          be either a host name (see _h_o_s_t_s(5)) or an Internet
          address specified in the "dot notation" (see _i_n_e_t(3N)).

     close
          Close a TELNET session and return to command mode.

     quit
          Close any open TELNET session and exit _t_e_l_n_e_t.  An end
          of file (in command mode) will also close a session and
          exit.

     z
          Suspend _t_e_l_n_e_t.  This command only works when the user
          is using the _c_s_h(1).

     mode _t_y_p_e
          _T_y_p_e is either _l_i_n_e (for "line by line" mode) or _c_h_a_r_-
          _a_c_t_e_r (for "character at a time" mode).  The remote
          host is asked for permission to go into the requested
          mode.  If the remote host is capable of entering that
          mode, the requested mode will be entered.

     status
          Show the current status of _t_e_l_n_e_t.  This includes the
          peer one is connected to, as well as the current mode.

     display [ _a_r_g_u_m_e_n_t... ]
          Displays all, or some, of the set and toggle values
          (see below).

     ? [ _c_o_m_m_a_n_d ]
          Get help.  With no arguments, _t_e_l_n_e_t prints a help sum-
          mary.  If a command is specified, _t_e_l_n_e_t will print the
          help information for just that command.

     send _a_r_g_u_m_e_n_t_s
          Sends one or more special character sequences to the
          remote host.  The following are the arguments which may
          be specified (more than one argument may be specified
          at a time):

          _e_s_c_a_p_e
               Sends the current _t_e_l_n_e_t escape character (ini-
               tially "^]").

          _s_y_n_c_h
               Sends the TELNET SYNCH sequence.  This sequence
               causes the remote system to discard all previously
               typed (but not yet read) input.  This sequence is
               sent as TCP urgent data (and may not work if the



Printed 12/27/86          May 10, 1986                          2






TELNET(1C)          UNIX Programmer's Manual           TELNET(1C)



               remote system is a 4.2 BSD system -- if it doesn't
               work, a lower case "r" may be echoed on the termi-
               nal).

          _b_r_k
               Sends the TELNET BRK (Break) sequence, which may
               have significance to the remote system.

          _i_p
               Sends the TELNET IP (Interrupt Process) sequence,
               which should cause the remote system to abort the
               currently running process.

          _a_o
               Sends the TELNET AO (Abort Output) sequence, which
               should cause the remote system to flush all output
               from the remote system to the user's terminal.

          _a_y_t
               Sends the TELNET AYT (Are You There) sequence, to
               which the remote system may or may not choose to
               respond.

          _e_c
               Sends the TELNET EC (Erase Character) sequence,
               which should cause the remote system to erase the
               last character entered.

          _e_l
               Sends the TELNET EL (Erase Line) sequence, which
               should cause the remote system to erase the line
               currently being entered.

          _g_a
               Sends the TELNET GA (Go Ahead) sequence, which
               likely has no significance to the remote system.

          _n_o_p
               Sends the TELNET NOP (No OPeration) sequence.

          ?
               Prints out help information for the send command.

     set _a_r_g_u_m_e_n_t _v_a_l_u_e
          Set any one of a number of _t_e_l_n_e_t variables to a
          specific value.  The special value "off" turns off the
          function associated with the variable.  The values of
          variables may be interrogated with the display command.
          The variables which may be specified are:

          _e_c_h_o
               This is the value (initially "^E") which, when in



Printed 12/27/86          May 10, 1986                          3






TELNET(1C)          UNIX Programmer's Manual           TELNET(1C)



               "line by line" mode, toggles between doing local
               echoing of entered characters (for normal process-
               ing), and suppressing echoing of entered charac-
               ters (for entering, say, a password).

          _e_s_c_a_p_e
               This is the _t_e_l_n_e_t escape character (initially
               "^[") which causes entry into _t_e_l_n_e_t command mode
               (when connected to a remote system).

          _i_n_t_e_r_r_u_p_t
               If _t_e_l_n_e_t is in _l_o_c_a_l_c_h_a_r_s mode (see toggle _l_o_c_a_l_-
               _c_h_a_r_s below) and the _i_n_t_e_r_r_u_p_t character is typed,
               a TELNET IP sequence (see send _i_p above) is sent
               to the remote host.  The initial value for the
               interrupt character is taken to be the terminal's
               intr character.

          _q_u_i_t
               If _t_e_l_n_e_t is in _l_o_c_a_l_c_h_a_r_s mode (see toggle _l_o_c_a_l_-
               _c_h_a_r_s below) and the _q_u_i_t character is typed, a
               TELNET BRK sequence (see send _b_r_k above) is sent
               to the remote host.  The initial value for the
               quit character is taken to be the terminal's quit
               character.

          _f_l_u_s_h_o_u_t_p_u_t
               If _t_e_l_n_e_t is in _l_o_c_a_l_c_h_a_r_s mode (see toggle _l_o_c_a_l_-
               _c_h_a_r_s below) and the _f_l_u_s_h_o_u_t_p_u_t character is
               typed, a TELNET AO sequence (see send _a_o above) is
               sent to the remote host.  The initial value for
               the flush character is taken to be the terminal's
               flush character.

          _e_r_a_s_e
               If _t_e_l_n_e_t is in _l_o_c_a_l_c_h_a_r_s mode (see toggle _l_o_c_a_l_-
               _c_h_a_r_s below), and if _t_e_l_n_e_t is operating in "char-
               acter at a time" mode, then when this character is
               typed, a TELNET EC sequence (see send _e_c above) is
               sent to the remote system.  The initial value for
               the erase character is taken to be the terminal's
               erase character.

          _k_i_l_l
               If _t_e_l_n_e_t is in _l_o_c_a_l_c_h_a_r_s mode (see toggle _l_o_c_a_l_-
               _c_h_a_r_s below), and if _t_e_l_n_e_t is operating in "char-
               acter at a time" mode, then when this character is
               typed, a TELNET EL sequence (see send _e_l above) is
               sent to the remote system.  The initial value for
               the kill character is taken to be the terminal's
               kill character.




Printed 12/27/86          May 10, 1986                          4






TELNET(1C)          UNIX Programmer's Manual           TELNET(1C)



          _e_o_f
               If _t_e_l_n_e_t is operating in "line by line" mode,
               entering this character as the first character on
               a line will cause this character to be sent to the
               remote system.  The initial value of the eof char-
               acter is taken to be the terminal's eof character.

     toggle _a_r_g_u_m_e_n_t_s...
          Toggle (between TRUE and FALSE) various flags that con-
          trol how _t_e_l_n_e_t responds to events.  More than one
          argument may be specified.  The state of these flags
          may be interrogated with the display command.  Valid
          arguments are:

          _l_o_c_a_l_c_h_a_r_s
               If this is TRUE, then the _f_l_u_s_h, _i_n_t_e_r_r_u_p_t, _q_u_i_t,
               _e_r_a_s_e, and _k_i_l_l characters (see set above) are
               recognized locally, and transformed into (hope-
               fully) appropriate TELNET control sequences
               (respectively _a_o, _i_p, _b_r_k, _e_c, and _e_l; see send
               above).  The initial value for this toggle is TRUE
               in "line by line" mode, and FALSE in "character at
               a time" mode.

          _a_u_t_o_f_l_u_s_h
               If _a_u_t_o_f_l_u_s_h and _l_o_c_a_l_c_h_a_r_s are both TRUE, then
               when the _a_o, _i_n_t_r, or _q_u_i_t characters are recog-
               nized (and transformed into TELNET sequences; see
               set above for details), _t_e_l_n_e_t refuses to display
               any data on the user's terminal until the remote
               system acknowledges (via a TELNET _T_i_m_i_n_g _M_a_r_k
               option) that it has processed those TELNET
               sequences.  The initial value for this toggle is
               TRUE if the terminal user had not done an "stty
               noflsh", otherwise FALSE (see _s_t_t_y(_1)).

          _a_u_t_o_s_y_n_c_h
               If _a_u_t_o_s_y_n_c_h and _l_o_c_a_l_c_h_a_r_s are both TRUE, then
               when either the _i_n_t_r or _q_u_i_t characters is typed
               (see set above for descriptions of the _i_n_t_r and
               _q_u_i_t characters), the resulting TELNET sequence
               sent is followed by the TELNET SYNCH sequence.
               This procedure should cause the remote system to
               begin throwing away all previously typed input
               until both of the TELNET sequences have been read
               and acted upon.  The initial value of this toggle
               is FALSE.

          _c_r_m_o_d
               Toggle carriage return mode.  When this mode is
               enabled, most carriage return characters received
               from the remote host will be mapped into a



Printed 12/27/86          May 10, 1986                          5






TELNET(1C)          UNIX Programmer's Manual           TELNET(1C)



               carriage return followed by a line feed.  This
               mode does not affect those characters typed by the
               user, only those received from the remote host.
               This mode is not very useful unless the remote
               host only sends carriage return, but never line
               feed.  The initial value for this toggle is FALSE.

          _d_e_b_u_g
               Toggles socket level debugging (useful only to the
               _s_u_p_e_ruser).  The initial value for this toggle is
               FALSE.

          _o_p_t_i_o_n_s
               Toggles the display of some internal _t_e_l_n_e_t proto-
               col processing (having to do with TELNET options).
               The initial value for this toggle is FALSE.

          _n_e_t_d_a_t_a
               Toggles the display of all network data (in hexa-
               decimal format).  The initial value for this tog-
               gle is FALSE.

          ?
               Displays the legal toggle commands.

BUGS
     There is no adequate way for dealing with flow control.

     On some remote systems, echo has to be turned off manually
     when in "line by line" mode.

     There is enough settable state to justify a ._t_e_l_n_e_t_r_c file.

     No capability for a ._t_e_l_n_e_t_r_c file is provided.

     In "line by line" mode, the terminal's _e_o_f character is only
     recognized (and sent to the remote system) when it is the
     first character on a line.

















Printed 12/27/86          May 10, 1986                          6