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

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