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

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

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

CVSweb <webmaster@jp.NetBSD.org>