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

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