[BACK]Return to telnet.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / telnet

Annotation of src/usr.bin/telnet/telnet.1, Revision 1.10

1.10    ! art         1: .\"    $OpenBSD: telnet.1,v 1.9 1997/12/25 00:29:26 deraadt Exp $
1.2       niklas      2: .\"    $NetBSD: telnet.1,v 1.5 1996/02/28 21:04:12 thorpej Exp $
                      3: .\"
1.1       deraadt     4: .\" Copyright (c) 1983, 1990, 1993
                      5: .\"    The Regents of the University of California.  All rights reserved.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms, with or without
                      8: .\" modification, are permitted provided that the following conditions
                      9: .\" are met:
                     10: .\" 1. Redistributions of source code must retain the above copyright
                     11: .\"    notice, this list of conditions and the following disclaimer.
                     12: .\" 2. Redistributions in binary form must reproduce the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer in the
                     14: .\"    documentation and/or other materials provided with the distribution.
                     15: .\" 3. All advertising materials mentioning features or use of this software
                     16: .\"    must display the following acknowledgement:
                     17: .\"    This product includes software developed by the University of
                     18: .\"    California, Berkeley and its contributors.
                     19: .\" 4. Neither the name of the University nor the names of its contributors
                     20: .\"    may be used to endorse or promote products derived from this software
                     21: .\"    without specific prior written permission.
                     22: .\"
                     23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     26: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     33: .\" SUCH DAMAGE.
                     34: .\"
                     35: .\"    from: @(#)telnet.1      8.4 (Berkeley) 2/3/94
                     36: .\"
                     37: .Dd February 3, 1994
                     38: .Dt TELNET 1
                     39: .Os BSD 4.2
                     40: .Sh NAME
                     41: .Nm telnet
                     42: .Nd user interface to the
                     43: .Tn TELNET
                     44: protocol
                     45: .Sh SYNOPSIS
                     46: .Nm telnet
                     47: .Op Fl 8
                     48: .Op Fl E
                     49: .Op Fl F
                     50: .Op Fl K
                     51: .Op Fl L
                     52: .Op Fl S Ar tos
                     53: .Op Fl X Ar authtype
                     54: .Op Fl a
1.3       niklas     55: .Op Fl b Ar hostalias
1.1       deraadt    56: .Op Fl c
                     57: .Op Fl d
                     58: .Op Fl e Ar escapechar
                     59: .Op Fl f
                     60: .Op Fl k Ar realm
                     61: .Op Fl l Ar user
                     62: .Op Fl n Ar tracefile
                     63: .Op Fl r
                     64: .Op Fl x
                     65: .Oo
                     66: .Ar host
1.9       deraadt    67: .Op Ar port
1.1       deraadt    68: .Oc
                     69: .Sh DESCRIPTION
                     70: The
                     71: .Nm telnet
                     72: command
                     73: is used to communicate with another host using the
                     74: .Tn TELNET
                     75: protocol.
                     76: If
                     77: .Nm telnet
                     78: is invoked without the
                     79: .Ar host
                     80: argument, it enters command mode,
                     81: indicated by its prompt
                     82: .Pq Nm telnet\&> .
                     83: In this mode, it accepts and executes the commands listed below.
                     84: If it is invoked with arguments, it performs an
                     85: .Ic open
                     86: command with those arguments.
                     87: .Pp
                     88: Options:
                     89: .Bl -tag -width indent
                     90: .It Fl 8
                     91: Specifies an 8-bit data path.  This causes an attempt to
                     92: negotiate the
                     93: .Dv TELNET BINARY
                     94: option on both input and output.
                     95: .It Fl E
                     96: Stops any character from being recognized as an escape character.
                     97: .It Fl F
                     98: If Kerberos V5 authentication is being used, the
                     99: .Fl F
                    100: option allows the local credentials to be forwarded
                    101: to the remote system, including any credentials that
                    102: have already been forwarded into the local environment.
                    103: .It Fl K
                    104: Specifies no automatic login to the remote system.
                    105: .It Fl L
                    106: Specifies an 8-bit data path on output.  This causes the
                    107: BINARY option to be negotiated on output.
                    108: .It Fl S Ar tos
                    109: Sets the IP type-of-service (TOS) option for the telnet
                    110: connection to the value
                    111: .Ar tos,
                    112: which can be a numeric TOS value
                    113: or, on systems that support it, a symbolic
                    114: TOS name found in the /etc/iptos file.
                    115: .It Fl X Ar atype
                    116: Disables the
                    117: .Ar atype
                    118: type of authentication.
                    119: .It Fl a
                    120: Attempt automatic login.
                    121: Currently, this sends the user name via the
                    122: .Ev USER
                    123: variable
                    124: of the
                    125: .Ev ENVIRON
                    126: option if supported by the remote system.
                    127: The name used is that of the current user as returned by
                    128: .Xr getlogin 2
                    129: if it agrees with the current user ID,
                    130: otherwise it is the name associated with the user ID.
1.3       niklas    131: .It Fl b Ar hostalias
                    132: Uses
                    133: .Xr bind 2
                    134: on the local socket to bind it to an aliased address (See
                    135: .Xr ifconfig 8
                    136: and the \*(Lqalias\*(Rq specifier) or to the address of
                    137: another interface than the one naturally chosen by
                    138: .Xr connect 2 .
                    139: This can be useful when connecting to services which uses IP addresses
                    140: for authentication and reconfiguration of the server is undesirable (or
                    141: impossible).
1.1       deraadt   142: .It Fl c
                    143: Disables the reading of the user's
                    144: .Pa \&.telnetrc
                    145: file.  (See the
                    146: .Ic toggle skiprc
                    147: command on this man page.)
                    148: .It Fl d
                    149: Sets the initial value of the
                    150: .Ic debug
                    151: toggle to
                    152: .Dv TRUE
1.8       deraadt   153: .It Fl e Ar escapechar
1.1       deraadt   154: Sets the initial
                    155: .Nm
                    156: escape character to
1.9       deraadt   157: .Ar escapechar Ns .
1.1       deraadt   158: If
1.8       deraadt   159: .Ar escapechar
1.1       deraadt   160: is omitted, then
                    161: there will be no escape character.
                    162: .It Fl f
                    163: If Kerberos V5 authentication is being used, the
                    164: .Fl f
                    165: option allows the local credentials to be forwarded to the remote system.
                    166: .It Fl k Ar realm
                    167: If Kerberos authentication is being used, the
                    168: .Fl k
                    169: option requests that telnet obtain tickets for the remote host in
1.8       deraadt   170: realm
                    171: .Ar realm
                    172: instead of the remote host's realm, as determined
1.1       deraadt   173: by
                    174: .Xr krb_realmofhost 3 .
                    175: .It Fl l Ar user
                    176: When connecting to the remote system, if the remote system
                    177: understands the
                    178: .Ev ENVIRON
                    179: option, then
                    180: .Ar user
                    181: will be sent to the remote system as the value for the variable USER.
                    182: This option implies the
                    183: .Fl a
                    184: option.
                    185: This option may also be used with the
                    186: .Ic open
                    187: command.
                    188: .It Fl n Ar tracefile
                    189: Opens
                    190: .Ar tracefile
                    191: for recording trace information.
                    192: See the
                    193: .Ic set tracefile
                    194: command below.
                    195: .It Fl r
                    196: Specifies a user interface similar to
                    197: .Xr rlogin 1 .
                    198: In this
                    199: mode, the escape character is set to the tilde (~) character,
1.8       deraadt   200: unless modified by the
                    201: .Fl e
                    202: option.
1.1       deraadt   203: .It Fl x
1.10    ! art       204: Turns on encryption of the data stream if possible.
1.1       deraadt   205: .It Ar host
                    206: Indicates the official name, an alias, or the Internet address
                    207: of a remote host.
                    208: .It Ar port
                    209: Indicates a port number (address of an application).  If a number is
                    210: not specified, the default
                    211: .Nm telnet
                    212: port is used.
                    213: .El
                    214: .Pp
                    215: When in rlogin mode, a line of the form ~.  disconnects from the
                    216: remote host; ~ is the telnet escape character.
                    217: Similarly, the line ~^Z suspends the telnet session.
                    218: The line ~^] escapes to the normal telnet escape prompt.
                    219: .Pp
                    220: Once a connection has been opened,
                    221: .Nm telnet
                    222: will attempt to enable the
                    223: .Dv TELNET LINEMODE
                    224: option.
                    225: If this fails, then
                    226: .Nm telnet
                    227: will revert to one of two input modes:
                    228: either \*(Lqcharacter at a time\*(Rq
                    229: or \*(Lqold line by line\*(Rq
                    230: depending on what the remote system supports.
                    231: .Pp
                    232: When
                    233: .Dv LINEMODE
                    234: is enabled, character processing is done on the
                    235: local system, under the control of the remote system.  When input
                    236: editing or character echoing is to be disabled, the remote system
                    237: will relay that information.  The remote system will also relay
                    238: changes to any special characters that happen on the remote
                    239: system, so that they can take effect on the local system.
                    240: .Pp
                    241: In \*(Lqcharacter at a time\*(Rq mode, most
                    242: text typed is immediately sent to the remote host for processing.
                    243: .Pp
                    244: In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
                    245: and (normally) only completed lines are sent to the remote host.
                    246: The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
                    247: to turn off and on the local echo
                    248: (this would mostly be used to enter passwords
                    249: without the password being echoed).
                    250: .Pp
                    251: If the
                    252: .Dv LINEMODE
                    253: option is enabled, or if the
                    254: .Ic localchars
                    255: toggle is
                    256: .Dv TRUE
                    257: (the default for \*(Lqold line by line\*(Lq; see below),
                    258: the user's
                    259: .Ic quit  ,
                    260: .Ic intr ,
                    261: and
                    262: .Ic flush
                    263: characters are trapped locally, and sent as
                    264: .Tn TELNET
                    265: protocol sequences to the remote side.
                    266: If
                    267: .Dv LINEMODE
                    268: has ever been enabled, then the user's
                    269: .Ic susp
                    270: and
                    271: .Ic eof
                    272: are also sent as
                    273: .Tn TELNET
                    274: protocol sequences,
                    275: and
                    276: .Ic quit
                    277: is sent as a
                    278: .Dv TELNET ABORT
                    279: instead of
1.8       deraadt   280: .Dv BREAK .
1.1       deraadt   281: There are options (see
                    282: .Ic toggle
                    283: .Ic autoflush
                    284: and
                    285: .Ic toggle
                    286: .Ic autosynch
                    287: below)
                    288: which cause this action to flush subsequent output to the terminal
                    289: (until the remote host acknowledges the
                    290: .Tn TELNET
                    291: sequence) and flush previous terminal input
                    292: (in the case of
                    293: .Ic quit
                    294: and
                    295: .Ic intr  ) .
                    296: .Pp
                    297: While connected to a remote host,
                    298: .Nm telnet
                    299: command mode may be entered by typing the
                    300: .Nm telnet
                    301: \*(Lqescape character\*(Rq (initially \*(Lq^]\*(Rq).
                    302: When in command mode, the normal terminal editing conventions are available.
                    303: .Pp
                    304: The following
                    305: .Nm telnet
                    306: commands are available.
                    307: Only enough of each command to uniquely identify it need be typed
                    308: (this is also true for arguments to the
                    309: .Ic mode  ,
                    310: .Ic set ,
                    311: .Ic toggle  ,
                    312: .Ic unset ,
                    313: .Ic slc  ,
                    314: .Ic environ ,
                    315: and
                    316: .Ic display
                    317: commands).
                    318: .Pp
                    319: .Bl -tag -width "mode type"
                    320: .It Ic auth Ar argument ...
                    321: The auth command manipulates the information sent through the
                    322: .Dv TELNET AUTHENTICATE
                    323: option.  Valid arguments for the
                    324: auth command are as follows:
                    325: .Bl -tag -width "disable type"
                    326: .It Ic disable Ar type
                    327: Disables the specified type of authentication.  To
                    328: obtain a list of available types, use the
                    329: .Ic auth disable \&?
                    330: command.
                    331: .It Ic enable Ar type
                    332: Enables the specified type of authentication.  To
                    333: obtain a list of available types, use the
                    334: .Ic auth enable \&?
                    335: command.
                    336: .It Ic status
                    337: Lists the current status of the various types of
                    338: authentication.
                    339: .El
                    340: .It Ic close
                    341: Close a
                    342: .Tn TELNET
                    343: session and return to command mode.
                    344: .It Ic display Ar argument ...
                    345: Displays all, or some, of the
                    346: .Ic set
                    347: and
                    348: .Ic toggle
                    349: values (see below).
                    350: .It Ic encrypt Ar argument ...
                    351: The encrypt command manipulates the information sent through the
                    352: .Dv TELNET ENCRYPT
                    353: option.
1.10    ! art       354: ..Pp
1.1       deraadt   355: Valid arguments for the encrypt command are as follows:
                    356: .Bl -tag -width Ar
                    357: .It Ic disable Ar type Ic [input|output]
                    358: Disables the specified type of encryption.  If you
                    359: omit the input and output, both input and output
                    360: are disabled.  To obtain a list of available
                    361: types, use the
                    362: .Ic encrypt disable \&?
                    363: command.
                    364: .It Ic enable Ar type Ic [input|output]
                    365: Enables the specified type of encryption.  If you
                    366: omit input and output, both input and output are
                    367: enabled.  To obtain a list of available types, use the
                    368: .Ic encrypt enable \&?
                    369: command.
                    370: .It Ic input
                    371: This is the same as the
                    372: .Ic encrypt start input
                    373: command.
                    374: .It Ic -input
                    375: This is the same as the
                    376: .Ic encrypt stop input
                    377: command.
                    378: .It Ic output
                    379: This is the same as the
                    380: .Ic encrypt start output
                    381: command.
                    382: .It Ic -output
                    383: This is the same as the
                    384: .Ic encrypt stop output
                    385: command.
                    386: .It Ic start Ic [input|output]
                    387: Attempts to start encryption.  If you omit
                    388: .Ic input
                    389: and
                    390: .Ic output,
                    391: both input and output are enabled.  To
                    392: obtain a list of available types, use the
                    393: .Ic encrypt enable \&?
                    394: command.
                    395: .It Ic status
                    396: Lists the current status of encryption.
                    397: .It Ic stop Ic [input|output]
                    398: Stops encryption.  If you omit input and output,
                    399: encryption is on both input and output.
                    400: .It Ic type Ar type
                    401: Sets the default type of encryption to be used
                    402: with later
                    403: .Ic encrypt start
                    404: or
                    405: .Ic encrypt stop
                    406: commands.
                    407: .El
                    408: .It Ic environ Ar arguments...
                    409: The
                    410: .Ic environ
                    411: command is used to manipulate the
1.8       deraadt   412: the variables that may be sent through the
1.1       deraadt   413: .Dv TELNET ENVIRON
                    414: option.
                    415: The initial set of variables is taken from the users
                    416: environment, with only the
                    417: .Ev DISPLAY
                    418: and
                    419: .Ev PRINTER
                    420: variables being exported by default.
                    421: The
                    422: .Ev USER
                    423: variable is also exported if the
                    424: .Fl a
                    425: or
                    426: .Fl l
                    427: options are used.
                    428: .br
                    429: Valid arguments for the
                    430: .Ic environ
                    431: command are:
                    432: .Bl -tag -width Fl
                    433: .It Ic define Ar variable value
                    434: Define the variable
                    435: .Ar variable
                    436: to have a value of
                    437: .Ar value.
                    438: Any variables defined by this command are automatically exported.
                    439: The
                    440: .Ar value
                    441: may be enclosed in single or double quotes so
                    442: that tabs and spaces may be included.
                    443: .It Ic undefine Ar variable
                    444: Remove
                    445: .Ar variable
                    446: from the list of environment variables.
                    447: .It Ic export Ar variable
                    448: Mark the variable
                    449: .Ar variable
                    450: to be exported to the remote side.
                    451: .It Ic unexport Ar variable
                    452: Mark the variable
                    453: .Ar variable
                    454: to not be exported unless
                    455: explicitly asked for by the remote side.
                    456: .It Ic list
                    457: List the current set of environment variables.
                    458: Those marked with a
                    459: .Cm *
                    460: will be sent automatically,
                    461: other variables will only be sent if explicitly requested.
                    462: .It Ic \&?
                    463: Prints out help information for the
                    464: .Ic environ
                    465: command.
                    466: .El
                    467: .It Ic logout
                    468: Sends the
                    469: .Dv TELNET LOGOUT
                    470: option to the remote side.
                    471: This command is similar to a
                    472: .Ic close
                    473: command; however, if the remote side does not support the
                    474: .Dv LOGOUT
                    475: option, nothing happens.
                    476: If, however, the remote side does support the
                    477: .Dv LOGOUT
                    478: option, this command should cause the remote side to close the
                    479: .Tn TELNET
                    480: connection.
                    481: If the remote side also supports the concept of
                    482: suspending a user's session for later reattachment,
                    483: the logout argument indicates that you
                    484: should terminate the session immediately.
                    485: .It Ic mode Ar type
                    486: .Ar Type
                    487: is one of several options, depending on the state of the
                    488: .Tn TELNET
                    489: session.
                    490: The remote host is asked for permission to go into the requested mode.
                    491: If the remote host is capable of entering that mode, the requested
                    492: mode will be entered.
                    493: .Bl -tag -width Ar
                    494: .It Ic character
                    495: Disable the
                    496: .Dv TELNET LINEMODE
                    497: option, or, if the remote side does not understand the
                    498: .Dv LINEMODE
                    499: option, then enter \*(Lqcharacter at a time\*(Lq mode.
                    500: .It Ic line
                    501: Enable the
                    502: .Dv TELNET LINEMODE
                    503: option, or, if the remote side does not understand the
                    504: .Dv LINEMODE
                    505: option, then attempt to enter \*(Lqold-line-by-line\*(Lq mode.
                    506: .It Ic isig Pq Ic \-isig
                    507: Attempt to enable (disable) the
                    508: .Dv TRAPSIG
                    509: mode of the
                    510: .Dv LINEMODE
                    511: option.
                    512: This requires that the
                    513: .Dv LINEMODE
                    514: option be enabled.
                    515: .It Ic edit Pq Ic \-edit
                    516: Attempt to enable (disable) the
                    517: .Dv EDIT
                    518: mode of the
                    519: .Dv LINEMODE
                    520: option.
                    521: This requires that the
                    522: .Dv LINEMODE
                    523: option be enabled.
                    524: .It Ic softtabs Pq Ic \-softtabs
                    525: Attempt to enable (disable) the
                    526: .Dv SOFT_TAB
                    527: mode of the
                    528: .Dv LINEMODE
                    529: option.
                    530: This requires that the
                    531: .Dv LINEMODE
                    532: option be enabled.
                    533: .It Ic litecho Pq Ic \-litecho
                    534: Attempt to enable (disable) the
                    535: .Dv LIT_ECHO
                    536: mode of the
                    537: .Dv LINEMODE
                    538: option.
                    539: This requires that the
                    540: .Dv LINEMODE
                    541: option be enabled.
                    542: .It Ic \&?
                    543: Prints out help information for the
                    544: .Ic mode
                    545: command.
                    546: .El
                    547: .It Xo
                    548: .Ic open Ar host
1.5       deraadt   549: .Op Fl l Ar user
                    550: .Oo Op Fl
1.1       deraadt   551: .Ar port Oc
                    552: .Xc
                    553: Open a connection to the named host.
                    554: If no port number
                    555: is specified,
                    556: .Nm telnet
                    557: will attempt to contact a
                    558: .Tn TELNET
                    559: server at the default port.
                    560: The host specification may be either a host name (see
1.7       deraadt   561: .Xr hosts 5 )
1.1       deraadt   562: or an Internet address specified in the \*(Lqdot notation\*(Rq (see
                    563: .Xr inet 3 ) .
                    564: The
1.5       deraadt   565: .Fl l
1.1       deraadt   566: option may be used to specify the user name
                    567: to be passed to the remote system via the
                    568: .Ev ENVIRON
                    569: option.
                    570: When connecting to a non-standard port,
                    571: .Nm telnet
                    572: omits any automatic initiation of
                    573: .Tn TELNET
                    574: options.  When the port number is preceded by a minus sign,
                    575: the initial option negotiation is done.
                    576: After establishing a connection, the file
                    577: .Pa \&.telnetrc
                    578: in the
1.7       deraadt   579: user's home directory is opened.  Lines beginning with a # are
1.1       deraadt   580: comment lines.  Blank lines are ignored.  Lines that begin
                    581: without white space are the start of a machine entry.  The
                    582: first thing on the line is the name of the machine that is
                    583: being connected to.  The rest of the line, and successive
                    584: lines that begin with white space are assumed to be
                    585: .Nm telnet
                    586: commands and are processed as if they had been typed
                    587: in manually to the
                    588: .Nm telnet
                    589: command prompt.
                    590: .It Ic quit
                    591: Close any open
                    592: .Tn TELNET
                    593: session and exit
                    594: .Nm telnet  .
                    595: An end of file (in command mode) will also close a session and exit.
                    596: .It Ic send Ar arguments
                    597: Sends one or more special character sequences to the remote host.
                    598: The following are the arguments which may be specified
                    599: (more than one argument may be specified at a time):
                    600: .Pp
                    601: .Bl -tag -width escape
                    602: .It Ic abort
                    603: Sends the
                    604: .Dv TELNET ABORT
                    605: (Abort
                    606: processes)
                    607: sequence.
                    608: .It Ic ao
                    609: Sends the
                    610: .Dv TELNET AO
                    611: (Abort Output) sequence, which should cause the remote system to flush
                    612: all output
                    613: .Em from
                    614: the remote system
                    615: .Em to
                    616: the user's terminal.
                    617: .It Ic ayt
                    618: Sends the
                    619: .Dv TELNET AYT
                    620: (Are You There)
                    621: sequence, to which the remote system may or may not choose to respond.
                    622: .It Ic brk
                    623: Sends the
                    624: .Dv TELNET BRK
                    625: (Break) sequence, which may have significance to the remote
                    626: system.
                    627: .It Ic ec
                    628: Sends the
                    629: .Dv TELNET EC
                    630: (Erase Character)
                    631: sequence, which should cause the remote system to erase the last character
                    632: entered.
                    633: .It Ic el
                    634: Sends the
                    635: .Dv TELNET EL
                    636: (Erase Line)
                    637: sequence, which should cause the remote system to erase the line currently
                    638: being entered.
                    639: .It Ic eof
                    640: Sends the
                    641: .Dv TELNET EOF
                    642: (End Of File)
                    643: sequence.
                    644: .It Ic eor
                    645: Sends the
                    646: .Dv TELNET EOR
                    647: (End of Record)
                    648: sequence.
                    649: .It Ic escape
                    650: Sends the current
                    651: .Nm telnet
                    652: escape character (initially \*(Lq^\*(Rq).
                    653: .It Ic ga
                    654: Sends the
                    655: .Dv TELNET GA
                    656: (Go Ahead)
                    657: sequence, which likely has no significance to the remote system.
                    658: .It Ic getstatus
                    659: If the remote side supports the
                    660: .Dv TELNET STATUS
                    661: command,
                    662: .Ic getstatus
                    663: will send the subnegotiation to request that the server send
                    664: its current option status.
                    665: .It Ic ip
                    666: Sends the
                    667: .Dv TELNET IP
                    668: (Interrupt Process) sequence, which should cause the remote
                    669: system to abort the currently running process.
                    670: .It Ic nop
                    671: Sends the
                    672: .Dv TELNET NOP
                    673: (No OPeration)
                    674: sequence.
                    675: .It Ic susp
                    676: Sends the
                    677: .Dv TELNET SUSP
                    678: (SUSPend process)
                    679: sequence.
                    680: .It Ic synch
                    681: Sends the
                    682: .Dv TELNET SYNCH
                    683: sequence.
                    684: This sequence causes the remote system to discard all previously typed
                    685: (but not yet read) input.
                    686: This sequence is sent as
                    687: .Tn TCP
                    688: urgent
                    689: data (and may not work if the remote system is a
                    690: .Bx 4.2
                    691: system -- if
                    692: it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
                    693: .It Ic do Ar cmd
                    694: .It Ic dont Ar cmd
                    695: .It Ic will Ar cmd
                    696: .It Ic wont Ar cmd
                    697: Sends the
                    698: .Dv TELNET DO
                    699: .Ar cmd
                    700: sequence.
                    701: .Ar Cmd
                    702: can be either a decimal number between 0 and 255,
                    703: or a symbolic name for a specific
                    704: .Dv TELNET
                    705: command.
                    706: .Ar Cmd
                    707: can also be either
                    708: .Ic help
                    709: or
                    710: .Ic \&?
                    711: to print out help information, including
                    712: a list of known symbolic names.
                    713: .It Ic \&?
                    714: Prints out help information for the
                    715: .Ic send
                    716: command.
                    717: .El
                    718: .It Ic set Ar argument value
                    719: .It Ic unset Ar argument value
                    720: The
                    721: .Ic set
                    722: command will set any one of a number of
                    723: .Nm telnet
                    724: variables to a specific value or to
                    725: .Dv TRUE .
                    726: The special value
                    727: .Ic off
                    728: turns off the function associated with
                    729: the variable, this is equivalent to using the
                    730: .Ic unset
                    731: command.
                    732: The
                    733: .Ic unset
                    734: command will disable or set to
                    735: .Dv FALSE
                    736: any of the specified functions.
                    737: The values of variables may be interrogated with the
                    738: .Ic display
                    739: command.
                    740: The variables which may be set or unset, but not toggled, are
                    741: listed here.  In addition, any of the variables for the
                    742: .Ic toggle
                    743: command may be explicitly set or unset using
                    744: the
                    745: .Ic set
                    746: and
                    747: .Ic unset
                    748: commands.
                    749: .Bl -tag -width escape
                    750: .It Ic ayt
                    751: If
                    752: .Tn TELNET
                    753: is in localchars mode, or
                    754: .Dv LINEMODE
                    755: is enabled, and the status character is typed, a
                    756: .Dv TELNET AYT
                    757: sequence (see
                    758: .Ic send ayt
                    759: preceding) is sent to the
                    760: remote host.  The initial value for the "Are You There"
                    761: character is the terminal's status character.
                    762: .It Ic echo
                    763: This is the value (initially \*(Lq^E\*(Rq) which, when in
                    764: \*(Lqline by line\*(Rq mode, toggles between doing local echoing
                    765: of entered characters (for normal processing), and suppressing
                    766: echoing of entered characters (for entering, say, a password).
                    767: .It Ic eof
                    768: If
                    769: .Nm telnet
                    770: is operating in
                    771: .Dv LINEMODE
                    772: or \*(Lqold line by line\*(Rq mode, entering this character
                    773: as the first character on a line will cause this character to be
                    774: sent to the remote system.
                    775: The initial value of the eof character is taken to be the terminal's
                    776: .Ic eof
                    777: character.
                    778: .It Ic erase
                    779: If
                    780: .Nm telnet
                    781: is in
                    782: .Ic localchars
                    783: mode (see
                    784: .Ic toggle
                    785: .Ic localchars
                    786: below),
                    787: .Sy and
                    788: if
                    789: .Nm telnet
                    790: is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
                    791: character is typed, a
                    792: .Dv TELNET EC
                    793: sequence (see
                    794: .Ic send
                    795: .Ic ec
                    796: above)
                    797: is sent to the remote system.
                    798: The initial value for the erase character is taken to be
                    799: the terminal's
                    800: .Ic erase
                    801: character.
                    802: .It Ic escape
                    803: This is the
                    804: .Nm telnet
                    805: escape character (initially \*(Lq^[\*(Rq) which causes entry
                    806: into
                    807: .Nm telnet
                    808: command mode (when connected to a remote system).
                    809: .It Ic flushoutput
                    810: If
                    811: .Nm telnet
                    812: is in
                    813: .Ic localchars
                    814: mode (see
                    815: .Ic toggle
                    816: .Ic localchars
                    817: below)
                    818: and the
                    819: .Ic flushoutput
                    820: character is typed, a
                    821: .Dv TELNET AO
                    822: sequence (see
                    823: .Ic send
                    824: .Ic ao
                    825: above)
                    826: is sent to the remote host.
                    827: The initial value for the flush character is taken to be
                    828: the terminal's
                    829: .Ic flush
                    830: character.
                    831: .It Ic forw1
                    832: .It Ic forw2
                    833: If
                    834: .Tn TELNET
                    835: is operating in
                    836: .Dv LINEMODE ,
                    837: these are the
                    838: characters that, when typed, cause partial lines to be
                    839: forwarded to the remote system.  The initial value for
                    840: the forwarding characters are taken from the terminal's
                    841: eol and eol2 characters.
                    842: .It Ic interrupt
                    843: If
                    844: .Nm telnet
                    845: is in
                    846: .Ic localchars
                    847: mode (see
                    848: .Ic toggle
                    849: .Ic localchars
                    850: below)
                    851: and the
                    852: .Ic interrupt
                    853: character is typed, a
                    854: .Dv TELNET IP
                    855: sequence (see
                    856: .Ic send
                    857: .Ic ip
                    858: above)
                    859: is sent to the remote host.
                    860: The initial value for the interrupt character is taken to be
                    861: the terminal's
                    862: .Ic intr
                    863: character.
                    864: .It Ic kill
                    865: If
                    866: .Nm telnet
                    867: is in
                    868: .Ic localchars
                    869: mode (see
                    870: .Ic toggle
                    871: .Ic localchars
                    872: below),
                    873: .Ic and
                    874: if
                    875: .Nm telnet
                    876: is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
                    877: character is typed, a
                    878: .Dv TELNET EL
                    879: sequence (see
                    880: .Ic send
                    881: .Ic el
                    882: above)
                    883: is sent to the remote system.
                    884: The initial value for the kill character is taken to be
                    885: the terminal's
                    886: .Ic kill
                    887: character.
                    888: .It Ic lnext
                    889: If
                    890: .Nm telnet
                    891: is operating in
                    892: .Dv LINEMODE
                    893: or \*(Lqold line by line\*(Lq mode, then this character is taken to
                    894: be the terminal's
                    895: .Ic lnext
                    896: character.
                    897: The initial value for the lnext character is taken to be
                    898: the terminal's
                    899: .Ic lnext
                    900: character.
                    901: .It Ic quit
                    902: If
                    903: .Nm telnet
                    904: is in
                    905: .Ic localchars
                    906: mode (see
                    907: .Ic toggle
                    908: .Ic localchars
                    909: below)
                    910: and the
                    911: .Ic quit
                    912: character is typed, a
                    913: .Dv TELNET BRK
                    914: sequence (see
                    915: .Ic send
                    916: .Ic brk
                    917: above)
                    918: is sent to the remote host.
                    919: The initial value for the quit character is taken to be
                    920: the terminal's
                    921: .Ic quit
                    922: character.
                    923: .It Ic reprint
                    924: If
                    925: .Nm telnet
                    926: is operating in
                    927: .Dv LINEMODE
                    928: or \*(Lqold line by line\*(Lq mode, then this character is taken to
                    929: be the terminal's
                    930: .Ic reprint
                    931: character.
                    932: The initial value for the reprint character is taken to be
                    933: the terminal's
                    934: .Ic reprint
                    935: character.
                    936: .It Ic rlogin
                    937: This is the rlogin escape character.
                    938: If set, the normal
                    939: .Tn TELNET
                    940: escape character is ignored unless it is
                    941: preceded by this character at the beginning of a line.
                    942: This character, at the beginning of a line followed by
                    943: a "."  closes the connection; when followed by a ^Z it
1.5       deraadt   944: suspends the
                    945: .Nm telnet
                    946: command.  The initial state is to
1.1       deraadt   947: disable the rlogin escape character.
                    948: .It Ic start
                    949: If the
                    950: .Dv TELNET TOGGLE-FLOW-CONTROL
                    951: option has been enabled,
                    952: then this character is taken to
                    953: be the terminal's
                    954: .Ic start
                    955: character.
1.5       deraadt   956: The initial value for the start character is taken to be
1.1       deraadt   957: the terminal's
                    958: .Ic start
                    959: character.
                    960: .It Ic stop
                    961: If the
                    962: .Dv TELNET TOGGLE-FLOW-CONTROL
                    963: option has been enabled,
                    964: then this character is taken to
                    965: be the terminal's
                    966: .Ic stop
                    967: character.
1.5       deraadt   968: The initial value for the stop character is taken to be
1.1       deraadt   969: the terminal's
                    970: .Ic stop
                    971: character.
                    972: .It Ic susp
                    973: If
                    974: .Nm telnet
                    975: is in
                    976: .Ic localchars
                    977: mode, or
                    978: .Dv LINEMODE
                    979: is enabled, and the
                    980: .Ic suspend
                    981: character is typed, a
                    982: .Dv TELNET SUSP
                    983: sequence (see
                    984: .Ic send
                    985: .Ic susp
                    986: above)
                    987: is sent to the remote host.
                    988: The initial value for the suspend character is taken to be
                    989: the terminal's
                    990: .Ic suspend
                    991: character.
                    992: .It Ic tracefile
                    993: This is the file to which the output, caused by
                    994: .Ic netdata
                    995: or
                    996: .Ic option
                    997: tracing being
                    998: .Dv TRUE ,
                    999: will be written.  If it is set to
                   1000: .Dq Fl ,
                   1001: then tracing information will be written to standard output (the default).
                   1002: .It Ic worderase
                   1003: If
                   1004: .Nm telnet
                   1005: is operating in
                   1006: .Dv LINEMODE
                   1007: or \*(Lqold line by line\*(Lq mode, then this character is taken to
                   1008: be the terminal's
                   1009: .Ic worderase
                   1010: character.
                   1011: The initial value for the worderase character is taken to be
                   1012: the terminal's
                   1013: .Ic worderase
                   1014: character.
                   1015: .It Ic \&?
                   1016: Displays the legal
                   1017: .Ic set
                   1018: .Pq Ic unset
                   1019: commands.
                   1020: .El
                   1021: .It Ic slc Ar state
                   1022: The
                   1023: .Ic slc
                   1024: command (Set Local Characters) is used to set
1.4       deraadt  1025: or change the state of the special
1.1       deraadt  1026: characters when the
                   1027: .Dv TELNET LINEMODE
                   1028: option has
                   1029: been enabled.  Special characters are characters that get
                   1030: mapped to
                   1031: .Tn TELNET
                   1032: commands sequences (like
                   1033: .Ic ip
                   1034: or
                   1035: .Ic quit  )
                   1036: or line editing characters (like
                   1037: .Ic erase
                   1038: and
                   1039: .Ic kill  ) .
                   1040: By default, the local special characters are exported.
                   1041: .Bl -tag -width Fl
                   1042: .It Ic check
                   1043: Verify the current settings for the current special characters.
                   1044: The remote side is requested to send all the current special
                   1045: character settings, and if there are any discrepancies with
                   1046: the local side, the local side will switch to the remote value.
                   1047: .It Ic export
                   1048: Switch to the local defaults for the special characters.  The
                   1049: local default characters are those of the local terminal at
                   1050: the time when
                   1051: .Nm telnet
                   1052: was started.
                   1053: .It Ic import
                   1054: Switch to the remote defaults for the special characters.
                   1055: The remote default characters are those of the remote system
                   1056: at the time when the
                   1057: .Tn TELNET
                   1058: connection was established.
                   1059: .It Ic \&?
                   1060: Prints out help information for the
                   1061: .Ic slc
                   1062: command.
                   1063: .El
                   1064: .It Ic status
                   1065: Show the current status of
                   1066: .Nm telnet  .
                   1067: This includes the peer one is connected to, as well
                   1068: as the current mode.
                   1069: .It Ic toggle Ar arguments ...
                   1070: Toggle (between
                   1071: .Dv TRUE
                   1072: and
                   1073: .Dv FALSE )
                   1074: various flags that control how
                   1075: .Nm telnet
                   1076: responds to events.
                   1077: These flags may be set explicitly to
                   1078: .Dv TRUE
                   1079: or
                   1080: .Dv FALSE
                   1081: using the
                   1082: .Ic set
                   1083: and
                   1084: .Ic unset
                   1085: commands listed above.
                   1086: More than one argument may be specified.
                   1087: The state of these flags may be interrogated with the
                   1088: .Ic display
                   1089: command.
                   1090: Valid arguments are:
                   1091: .Bl -tag -width Ar
                   1092: .It Ic authdebug
                   1093: Turns on debugging information for the authentication code.
                   1094: .It Ic autoflush
                   1095: If
                   1096: .Ic autoflush
                   1097: and
                   1098: .Ic localchars
                   1099: are both
                   1100: .Dv TRUE ,
                   1101: then when the
                   1102: .Ic ao  ,
                   1103: or
                   1104: .Ic quit
                   1105: characters are recognized (and transformed into
                   1106: .Tn TELNET
                   1107: sequences; see
                   1108: .Ic set
                   1109: above for details),
                   1110: .Nm telnet
                   1111: refuses to display any data on the user's terminal
                   1112: until the remote system acknowledges (via a
                   1113: .Dv TELNET TIMING MARK
                   1114: option)
                   1115: that it has processed those
                   1116: .Tn TELNET
                   1117: sequences.
                   1118: The initial value for this toggle is
                   1119: .Dv TRUE
                   1120: if the terminal user had not
                   1121: done an "stty noflsh", otherwise
                   1122: .Dv FALSE
                   1123: (see
                   1124: .Xr stty  1  ) .
                   1125: .It Ic autodecrypt
                   1126: When the
                   1127: .Dv TELNET ENCRYPT
                   1128: option is negotiated, by
                   1129: default the actual encryption (decryption) of the data
                   1130: stream does not start automatically.  The autoencrypt
                   1131: (autodecrypt) command states that encryption of the
                   1132: output (input) stream should be enabled as soon as
                   1133: possible.
                   1134: .Pp
                   1135: .It Ic autologin
                   1136: If the remote side supports the
                   1137: .Dv TELNET AUTHENTICATION
                   1138: option
                   1139: .Tn TELNET
                   1140: attempts to use it to perform automatic authentication.  If the
                   1141: .Dv AUTHENTICATION
                   1142: option is not supported, the user's login
                   1143: name are propagated through the
                   1144: .Dv TELNET ENVIRON
                   1145: option.
                   1146: This command is the same as specifying
                   1147: .Ar a
                   1148: option on the
                   1149: .Ic open
                   1150: command.
                   1151: .It Ic autosynch
                   1152: If
                   1153: .Ic autosynch
                   1154: and
                   1155: .Ic localchars
                   1156: are both
                   1157: .Dv TRUE ,
                   1158: then when either the
                   1159: .Ic intr
                   1160: or
                   1161: .Ic quit
                   1162: characters is typed (see
                   1163: .Ic set
                   1164: above for descriptions of the
                   1165: .Ic intr
                   1166: and
                   1167: .Ic quit
                   1168: characters), the resulting
                   1169: .Tn TELNET
                   1170: sequence sent is followed by the
                   1171: .Dv TELNET SYNCH
                   1172: sequence.
                   1173: This procedure
                   1174: .Ic should
                   1175: cause the remote system to begin throwing away all previously
                   1176: typed input until both of the
                   1177: .Tn TELNET
                   1178: sequences have been read and acted upon.
                   1179: The initial value of this toggle is
                   1180: .Dv FALSE .
                   1181: .It Ic binary
                   1182: Enable or disable the
                   1183: .Dv TELNET BINARY
                   1184: option on both input and output.
                   1185: .It Ic inbinary
                   1186: Enable or disable the
                   1187: .Dv TELNET BINARY
                   1188: option on input.
                   1189: .It Ic outbinary
                   1190: Enable or disable the
                   1191: .Dv TELNET BINARY
                   1192: option on output.
                   1193: .It Ic crlf
                   1194: If this is
                   1195: .Dv TRUE ,
                   1196: then carriage returns will be sent as
                   1197: .Li <CR><LF> .
                   1198: If this is
                   1199: .Dv FALSE ,
                   1200: then carriage returns will be send as
                   1201: .Li <CR><NUL> .
                   1202: The initial value for this toggle is
                   1203: .Dv FALSE .
                   1204: .It Ic crmod
                   1205: Toggle carriage return mode.
                   1206: When this mode is enabled, most carriage return characters received from
                   1207: the remote host will be mapped into a carriage return followed by
                   1208: a line feed.
                   1209: This mode does not affect those characters typed by the user, only
                   1210: those received from the remote host.
                   1211: This mode is not very useful unless the remote host
                   1212: only sends carriage return, but never line feed.
                   1213: The initial value for this toggle is
                   1214: .Dv FALSE .
                   1215: .It Ic debug
                   1216: Toggles socket level debugging (useful only to the
                   1217: .Ic super user  ) .
                   1218: The initial value for this toggle is
                   1219: .Dv FALSE .
                   1220: .It Ic encdebug
                   1221: Turns on debugging information for the encryption code.
                   1222: .It Ic localchars
                   1223: If this is
                   1224: .Dv TRUE ,
                   1225: then the
                   1226: .Ic flush  ,
                   1227: .Ic interrupt ,
                   1228: .Ic quit  ,
                   1229: .Ic erase ,
                   1230: and
                   1231: .Ic kill
                   1232: characters (see
                   1233: .Ic set
                   1234: above) are recognized locally, and transformed into (hopefully) appropriate
                   1235: .Tn TELNET
                   1236: control sequences
                   1237: (respectively
                   1238: .Ic ao  ,
                   1239: .Ic ip ,
                   1240: .Ic brk  ,
                   1241: .Ic ec ,
                   1242: and
                   1243: .Ic el  ;
                   1244: see
                   1245: .Ic send
                   1246: above).
                   1247: The initial value for this toggle is
                   1248: .Dv TRUE
                   1249: in \*(Lqold line by line\*(Rq mode,
                   1250: and
                   1251: .Dv FALSE
                   1252: in \*(Lqcharacter at a time\*(Rq mode.
                   1253: When the
                   1254: .Dv LINEMODE
                   1255: option is enabled, the value of
                   1256: .Ic localchars
                   1257: is ignored, and assumed to always be
                   1258: .Dv TRUE .
                   1259: If
                   1260: .Dv LINEMODE
                   1261: has ever been enabled, then
                   1262: .Ic quit
                   1263: is sent as
                   1264: .Ic abort  ,
                   1265: and
                   1266: .Ic eof and
1.5       deraadt  1267: .Ic suspend
1.1       deraadt  1268: are sent as
                   1269: .Ic eof and
1.5       deraadt  1270: .Ic susp
                   1271: (see
1.1       deraadt  1272: .Ic send
                   1273: above).
                   1274: .It Ic netdata
                   1275: Toggles the display of all network data (in hexadecimal format).
                   1276: The initial value for this toggle is
                   1277: .Dv FALSE .
                   1278: .It Ic options
                   1279: Toggles the display of some internal
                   1280: .Nm telnet
                   1281: protocol processing (having to do with
                   1282: .Tn TELNET
                   1283: options).
                   1284: The initial value for this toggle is
                   1285: .Dv FALSE .
                   1286: .It Ic prettydump
                   1287: When the
                   1288: .Ic netdata
                   1289: toggle is enabled, if
                   1290: .Ic prettydump
                   1291: is enabled the output from the
                   1292: .Ic netdata
                   1293: command will be formatted in a more user readable format.
                   1294: Spaces are put between each character in the output, and the
                   1295: beginning of any
                   1296: .Tn TELNET
                   1297: escape sequence is preceded by a '*' to aid in locating them.
                   1298: .It Ic skiprc
                   1299: When the skiprc toggle is
                   1300: .Dv TRUE ,
                   1301: .Tn TELNET
                   1302: skips the reading of the
                   1303: .Pa \&.telnetrc
                   1304: file in the users home
                   1305: directory when connections are opened.  The initial
                   1306: value for this toggle is
                   1307: .Dv FALSE.
                   1308: .It Ic termdata
                   1309: Toggles the display of all terminal data (in hexadecimal format).
                   1310: The initial value for this toggle is
                   1311: .Dv FALSE .
                   1312: .It Ic verbose_encrypt
                   1313: When the
                   1314: .Ic verbose_encrypt
                   1315: toggle is
                   1316: .Dv TRUE ,
1.5       deraadt  1317: .Nm telnet
1.1       deraadt  1318: prints out a message each time encryption is enabled or
                   1319: disabled.  The initial value for this toggle is
                   1320: .Dv FALSE.
                   1321: .It Ic \&?
                   1322: Displays the legal
                   1323: .Ic toggle
                   1324: commands.
                   1325: .El
                   1326: .It Ic z
                   1327: Suspend
                   1328: .Nm telnet  .
                   1329: This command only works when the user is using the
                   1330: .Xr csh  1  .
                   1331: .It Ic \&! Op Ar command
                   1332: Execute a single command in a subshell on the local
                   1333: system.  If
1.5       deraadt  1334: .Ar command
1.1       deraadt  1335: is omitted, then an interactive
                   1336: subshell is invoked.
                   1337: .It Ic \&? Op Ar command
                   1338: Get help.  With no arguments,
                   1339: .Nm telnet
                   1340: prints a help summary.
                   1341: If a command is specified,
                   1342: .Nm telnet
                   1343: will print the help information for just that command.
                   1344: .El
                   1345: .Sh ENVIRONMENT
                   1346: .Nm Telnet
                   1347: uses at least the
                   1348: .Ev HOME ,
                   1349: .Ev SHELL ,
                   1350: .Ev DISPLAY ,
                   1351: and
                   1352: .Ev TERM
                   1353: environment variables.
                   1354: Other environment variables may be propagated
                   1355: to the other side via the
                   1356: .Dv TELNET ENVIRON
                   1357: option.
                   1358: .Sh FILES
                   1359: .Bl -tag -width ~/.telnetrc -compact
                   1360: .It Pa ~/.telnetrc
                   1361: user customized telnet startup values
                   1362: .El
                   1363: .Sh HISTORY
                   1364: The
                   1365: .Nm Telnet
                   1366: command appeared in
                   1367: .Bx 4.2 .
                   1368: .Sh NOTES
                   1369: .Pp
                   1370: On some remote systems, echo has to be turned off manually when in
                   1371: \*(Lqold line by line\*(Rq mode.
                   1372: .Pp
                   1373: In \*(Lqold line by line\*(Rq mode or
                   1374: .Dv LINEMODE
                   1375: the terminal's
                   1376: .Ic eof
                   1377: character is only recognized (and sent to the remote system)
                   1378: when it is the first character on a line.