hpux 10.20 - telnet (1)



 NAME
      telnet - user interface to the TELNET protocol

 SYNOPSIS
      telnet [[options]host [port]]

 DESCRIPTION
      telnet is used to communicate with another host using the TELNET
      protocol.  If telnet 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 telnet is invoked with
      arguments, it performs an open command (see below) with those
      arguments.

      Once a connection has been opened, telnet enters an input mode.  The
      input mode 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 immediately 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) can 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 localchars toggle is TRUE (the default in line
      mode; see below), the user's quit and intr characters are trapped
      locally, and sent as TELNET protocol sequences to the remote side.
      There are options (see toggle autoflush and toggle autosynch 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 quit and intr).

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

      telnet supports eight-bit characters when communicating with the
      server on the remote host.  To use eight-bit characters you may need
      to reconfigure your terminal or the remote host appropriately (see
      stty(1)).  Furthermore, you may have to use the binary toggle to
      enable an 8-bit data stream between telnet and the remote host.  Note
      that some remote hosts may not provide the necessary support for
      eight-bit characters.

      If, at any time, telnet is unable to read from or write to the server
      over the connection, the message Connection closed by foreign host. is
      printed on standard error.  telnet then exits with a value of 1.


      telnet supports the TAC User ID (also known as the TAC Access Control
      System, or TACACS User ID) option.  Enabling the option on a host
      server allows the user to telnet into that host without being prompted
      for a second login sequence.  The TAC User ID option uses the same
      security mechanism as rlogin for authorizing acces by remote hosts and
      users.  The system administrator must enable the (telnetd) option only
      on systems which are designated as participating hosts.  The system
      administrator must also assign to each user of TAC User ID the very
      same UID on every system for which he is allowed to use the feature.
      (See telnetd(1M) and the System Administration Tasks manual, PN 2355-
      90051.)

      The following telnet options are available:

      -8        Enable cs8 (8 bit transfer) on local tty.

      -ec       Set the telnet command mode escape character to be ^c
                instead of its default value of ^].

      -l        Disable the TAC User ID option if enabled on the client, to
                cause the user to be prompted for login username and
                password. Omitting the -l option executes the default
                setting.

    Commands
      The following commands are available in command mode.  You need only
      type enough of each command to uniquely identify it (this is also true
      for arguments to the mode, set, toggle, and display commands).

      open host [port]
                     Open a connection to the named host at the indicated
                     port.  If no port is specified, telnet attempts to
                     contact a TELNET server at the standard TELNET port.
                     The hostname can be either the official name or an
                     alias as understood by gethostbyname() (see
                     gethostent(3N)), or an Internet address specified in
                     the dot notation as described in hosts(4).  If no
                     hostname is given, telnet prompts for one.

      close          Close a TELNET session.  If the session was started
                     from command mode, telnet returns to command mode;
                     otherwise telnet exits.

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

      z              Suspend telnet.  If telnet is run from a shell that
                     supports job control, (such as csh(1) or ksh(1)), the z
                     command suspends the TELNET session and returns the
                     user to the shell that invoked telnet.  The job can

                     then be resumed with the fg command (see csh(1) or
                     ksh(1)).

      mode mode      Change telnet's user input mode to mode, which can be
                     character (for ``character at a time'' mode) or line
                     (for ``line by line'' 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 is entered.  In character mode, telnet
                     sends each character to the remote host as it is typed.
                     In line mode, telnet gathers user input into lines and
                     transmits each line to the remote host when the user
                     types carriage return, linefeed, or EOF (normally ^D;
                     see stty(1)).  Note that setting line-mode also sets
                     local echo.  Applications that expect to interpret user
                     input character by character (such as more, csh, ksh,
                     and vi) do not work correctly in line mode.

      status         Show current status of telnet.  telnet reports the
                     current escape character.  If telnet is connected, it
                     reports the host to which it is connected and the
                     current mode.  If telnet is not connected to a remote
                     host, it reports No connection. Once telnet has been
                     connected, it reports the local flow control toggle
                     value.

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

      ? [command]    Get help.  With no arguments, telnet prints a help
                     summary.  If a command is specified, telnet prints the
                     help information available about that command only.
                     Help information is limited to a one-line description
                     of the command.

      ! [shell_command]
                     Shell escape.  The SHELL environment variable is
                     checked for the name of a shell to use to execute the
                     command.  If no shell_command is specified, a shell is
                     started and connected to the user's terminal.  If SHELL
                     is undefined, /usr/bin/sh is used.

      send arguments Sends one or more special character sequences to the
                     remote host.  Each argument can have any of the
                     following values (multiple arguments can be specified
                     with each send command):

                          escape    Sends the current telnet escape
                                    character (initially ^]).


                          synch     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 to
                                    some systems -- if it doesn't work, a
                                    lower case ``r'' may be echoed on the
                                    terminal).

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

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

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

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

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

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

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

                          nop       Sends the TELNET NOP (No OPeration)
                                    sequence.

                          ?         Prints out help information for the send
                                    command.

      set variable_name value
                     Set any one of a number of telnet variables to a
                     specific value.  The special value off turns off the
                     function associated with the variable.  The values of

                     variables can be shown by using the display command.
                     The following variable_names can be specified:

                     echo This is the value (initially ^E) which, when in
                          line-by-line mode, toggles between doing local
                          echoing of entered characters (for normal
                          processing), and suppressing echoing of entered
                          characters (for entering, for example, a
                          password).

                     escape
                          This is the telnet escape character (initially ^])
                          which causes entry into telnet command mode (when
                          connected to a remote system).

                     interrupt
                          If telnet is in localchars mode (see toggle
                          localchars below) and the interrupt character is
                          typed, a TELNET IP sequence (see send ip above) is
                          sent to the remote host.  The initial value for
                          the interrupt character is taken to be the
                          terminal's intr character.

                     quit If telnet is in localchars mode (see toggle
                          localchars below) and the quit character is typed,
                          a TELNET BRK sequence (see send brk above) is sent
                          to the remote host.  The initial value for the
                          quit character is taken to be the terminal's quit
                          character.

                     flushoutput
                          If telnet is in localchars mode (see toggle
                          localchars below) and the flushoutput character is
                          typed, a TELNET AO sequence (see send ao above) is
                          sent to the remote host.  The initial value for
                          the flush character is ^O.

                     erase
                          If telnet is in localchars mode (see toggle
                          localchars below), and if telnet is operating in
                          character-at-a-time mode, then when this character
                          is typed, a TELNET EC sequence (see send ec above)
                          is sent to the remote system.  The initial value
                          for the erase character is taken to be the
                          terminal's erase character.

                     kill If telnet is in localchars mode (see toggle
                          localchars below), and if telnet is operating in
                          character-at-a-time mode, then when this character
                          is typed, a TELNET EL sequence (see send el above)
                          is sent to the remote system.  The initial value

                          for the kill character is taken to be the
                          terminal's kill character.

                     eof  If telnet is operating in line-by-line mode,
                          entering this character as the first character on
                          a line causes this character to be sent to the
                          remote system.  The initial value of the eof
                          character is taken to be the terminal's eof
                          character.

      toggle arguments ...
                     Toggle (between TRUE and FALSE ) various flags that
                     control how telnet responds to events.  More than one
                     argument can be specified.  The state of these flags
                     can be shown by using the display command.  Valid
                     arguments are:

                          localchars
                               If TRUE, the flush, interrupt, quit, erase,
                               and kill characters (see set above) are
                               recognized locally, and transformed into
                               appropriate TELNET control sequences
                               (respectively ao, ip, brk, ec, and el; see
                               send above).  The initial value for this
                               toggle is TRUE in line-by-line mode, and
                               FALSE in character-at-a-time mode.

                          autoflush
                               If autoflush and localchars are both TRUE,
                               whenever the ao, intr, or quit characters are
                               recognized (and transformed into TELNET
                               sequences - see set above for details),
                               telnet refuses to display any data on the
                               user's terminal until the remote system
                               acknowledges (via a TELNET Timing Mark
                               option) that it has processed those TELNET
                               sequences.  The initial value for this toggle
                               is TRUE.

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

                          binary
                               Enable or disable the TELNET BINARY option on
                               both input and output.  This option should be
                               enabled in order to send and receive 8-bit
                               characters to and from the TELNET server.

                          crlf If TRUE, end-of-line sequences are sent as an
                               ASCII carriage-return and line-feed pair.  If
                               FALSE, end-of-line sequences are sent as an
                               ASCII carriage-return and NUL character pair.
                               The initial value for this toggle is FALSE.

                          crmod
                               Toggle carriage return mode.  When this mode
                               is enabled, any carriage return characters
                               received from the remote host are mapped into
                               a carriage return and a line feed.  This mode
                               does not affect those characters typed by the
                               user; only those received.  This mode is only
                               required for some hosts that require the
                               client to do local echoing, but output
                               ``naked'' carriage returns.  The initial
                               value for this toggle is FALSE.

                          echo Toggle local echo mode or remote echo mode.
                               In local echo mode, user input is echoed to
                               the terminal by the local telnet before being
                               transmitted to the remote host.  In remote
                               echo, any echoing of user input is done by
                               the remote host.  Applications that handle
                               echoing of user input themselves, such as C
                               shell, Korn shell, and vi (see csh(1),
                               ksh(1), and vi(1)), do not work correctly
                               with local echo.

                          options
                               Toggle viewing of TELNET options processing.
                               When options viewing is enabled, all TELNET
                               option negotiations are displayed.  Options
                               sent by telnet are displayed as ``SENT'',
                               while options received from the TELNET server
                               are displayed as ``RCVD''.  The initial value
                               for this toggle is FALSE.

                          netdata
                               Toggles the display of all network data (in
                               hexadecimal format).  The initial value for
                               this toggle is FALSE.

                          ?    Displays the legal toggle commands.


 RETURN VALUE
      In the event of an error, or if the TELNET connection is closed by the
      remote host, telnet returns a value of 1.  Otherwise it returns zero
      (0).

 DIAGNOSTICS
      The following diagnostic messages are displayed by telnet:

           telnet/tcp: Unknown service
                telnet was unable to find the TELNET service entry in the
                services(4) database.

           hostname: Unknown host
                telnet was unable to map the host name to an Internet
                address.  Your next step should be to contact the system
                administrator to check whether there is an entry for the
                remote host in the hosts database (see hosts(4)).

           ?Invalid command
                An invalid command was typed in telnet command mode.

           system call>: ...
                An error occurred in the specified system call.  See the
                appropriate manual entry for a description of the error.

 AUTHOR
      telnet was developed by the University of California, Berkeley.

 SEE ALSO
      csh(1), ksh(1), login(1), rlogin(1), stty(1), telnetd(1M), hosts(4),
      services(4), termio(7).