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

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