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

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