telnet.1   [plain text]


.\" Copyright (c) 1983, 1990, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"	@(#)telnet.1	8.4 (Berkeley) 2/3/94
.\" "
.TH TELNET 1
.SH NAME
telnet \- user interface to the TELNET protocol
.SH SYNOPSIS
.B telnet
[\fB\-8\fP] [\fB\-E\fP] [\fB\-F\fP] [\fB\-K\fP] [\fB\-L\fP] [\fB\-S\fP
\fItos\fP] [\fB\-X\fP \fIauthtype\fP] [\fB\-a\fP] [\fB\-c\fP]
[\fB\-d\fP] [\fB\-e\fP \fIescapechar\fP] [\fB\-f\fP] [\fB\-k\fP
\fIrealm\fP] [\fB\-l\fP \fIuser\fP] [\fB\-n\fP \fItracefile\fP]
[\fB\-r\fP] [\fB\-x\fP] [\fIhost\fP [\fIport\fP]]
.SH DESCRIPTION
The 
.B telnet
command is used to communicate with another host using the
.SM TELNET
protocol.  If
.B telnet
is invoked without the
.I host
argument, it enters command mode, indicated by its prompt (
.BR telnet\&> ).
In this mode, it accepts and executes the commands listed below.  If it
is invoked with arguments, it performs an
.B open
command with those arguments.
.SH OPTIONS
.TP
.B \-8
Specify an 8-bit data path.  This causes an attempt to negotiate the
.SM TELNET BINARY
option on both input and output.
.TP
.B \-E
Stop any character from being recognized as an escape character.
.TP
\fB\-F\fP
forward a
.I forwardable
copy of the local credentials to the remote system.
.TP
\fB\-K\fP
Specify no automatic login to the remote system.
.TP
.B \-L
Specify an 8-bit data path on output.  This causes the BINARY option to
be negotiated on output.
.TP
\fB\-S\fP \fItos\fP
Set the IP type-of-service (TOS) option for the telnet connection to the
value
.I tos,
which can be a numeric TOS value (in decimal, or a hex value preceded
by 0x, or an octal value preceded by a leading 0) or, on systems that support it, a
symbolic TOS name found in the /etc/iptos file.
.TP
\fB\-X\fP \fIatype\fP
Disable the
.I atype
type of authentication.
.TP
\fB\-a\fP
Attempt automatic login.  This sends the user name via the
.SM USER
variable of the
.SM ENVIRON
option, if supported by the remote system.  The name used is that of the
current user as returned by
.IR getlogin (2)
if it agrees with the current user ID; otherwise it is the name
associated with the user ID.
.TP
.B \-c
Disable the reading of the user's
.B \&.telnetrc
file.  (See the
.B toggle skiprc
command on this man page.)
.TP
.B \-d
Set the initial value of the
.B debug
flag to TRUE
.TP
\fB\-e\fP \fIescape char\fP
Set the initial
.B telnet
escape character to
.I escape char.
If
.I escape char
is omitted, then there will be no escape character.
.TP
\fB\-f\fP
forward a copy of the local credentials to the remote system.
.TP
\fB\-k\fP \fIrealm\fP
If Kerberos authentication is being used, request that telnet obtain
tickets for the remote host in realm
.I realm
instead of the remote host's realm, as determined by
.IR krb_realmofhost (3).
.TP
\fB\-l\fP \fIuser\fP
If the remote system understands the
.SM ENVIRON
option, then
.I user
will be sent to the remote system as the value for the variable 
.SM USER.
This option implies the
.B \-a
option.  This option may also be used with the
.B open
command.
.TP
\fB\-n\fP \fItracefile\fP
Open
.I tracefile
for recording trace information.  See the
.B set tracefile
command below.
.TP
.B \-r
Specify a user interface similar to
.IR rlogin (1).
In this mode, the escape character is set to the tilde (~) character,
unless modified by the
.B \-e
option.
.TP
\fB\-x\fP
Turn on encryption of the data stream.  When this option is turned on,
.B telnet
will exit with an error if authentication cannot be negotiated or if
encryption cannot be turned on.
.TP
.I host
Indicates the name, alias, or Internet address of the remote host.
.TP
.I port
Indicates a port number (address of an application).  If the port is not
specified, the default
.B telnet
port (23) is used.
.PP
When in rlogin mode, ~ is the telnet escape character; a line of the
form ~. disconnects from the remote host.  Similarly, the line ~^Z
suspends the telnet session.  The line ~^] escapes to the normal telnet
escape prompt.
.PP
Once a connection has been opened,
.B telnet
will attempt to enable the
.SM TELNET LINEMODE
option.  If this fails, then
.B telnet
will revert to one of two input modes: either ``character at a time'' or
``old line by line,'' depending on what the remote system supports.
.PP
When
.SM LINEMODE
is enabled, character processing is done on the local system, under the
control of the remote system.  When input editing or character echoing
is to be disabled, the remote system will relay that information.  The
remote system will also relay changes to any special characters that
happen on the remote system, so that they can take effect on the local
system.
.PP
In ``character at a time'' mode, most text typed is immediately sent to
the remote host for processing.
.PP
In ``old line by line'' mode, all text is echoed locally, and (normally)
only completed lines are sent to the remote host.  The ``local echo
character'' (initially ``^E'') may be used to turn off and on the local
echo.  (This would mostly be used to enter passwords without the
password being echoed).
.PP
If the LINEMODE option is enabled, or if the
.B localchars
flag is TRUE (the default for ``old line by line''; see below), the
user's
.BR quit  ,
.BR intr ,
and
.BR flush
characters are trapped locally, and sent as
.SM TELNET
protocol sequences to the remote side.  If
.SM LINEMODE
has ever been enabled, then the user's
.B susp
and
.B eof
are also sent as
.SM TELNET
protocol sequences, and
.B quit
is sent as a
.SM TELNET ABORT
instead of
.SM BREAK.
There are options (see
.B toggle autoflush
and
.B toggle autosynch
below) which cause this action to flush subsequent output to the
terminal (until the remote host acknowledges the 
.SM TELNET
sequence) and flush previous terminal input (in the case of
.B quit
and
.BR intr  ).
.PP
While connected to a remote host,
.B telnet
command mode may be entered by typing the
.B telnet
``escape character'' (initially ``^]'').  When in command mode, the
normal terminal editing conventions are available.
.PP
The following
.B telnet
commands are available.  Only enough of each command to uniquely
identify it need be typed (this is also true for arguments to the
.BR mode ,
.BR set ,
.BR toggle ,
.BR unset ,
.BR slc ,
.BR environ ,
and
.B display
commands).
.PP
.TP
\fBauth\fP \fIargument ...\fP
The auth command manipulates the information sent through the
.SM TELNET AUTHENTICATE
option.  Valid arguments for the auth command are as
follows:
.RS
.TP
\fBdisable\fP \fItype\fP 
Disables the specified type of authentication.  To obtain a list of
available types, use the
.B auth disable \&?
command.
.TP
\fBenable\fP \fItype\fP
Enables the specified type of authentication.  To obtain a list of
available types, use the
.B auth enable \&?
command.
.TP
.B status
Lists the current status of the various types of authentication.
.RE
.TP
.B close
Close a
.SM TELNET
session and return to command mode.
.TP
\fBdisplay\fP \fIargument ...\fP
Displays some or all of the
.B set
and
.B toggle
values (see below).
.TP
\fBencrypt\fP \fIargument ...\fP
The encrypt command manipulates the information sent through the
.SM TELNET ENCRYPT
option.
.PP
Note:  Because of export controls, the
.SM TELNET ENCRYPT
option is not supported outside of the United States and Canada.
.PP
Valid arguments for the encrypt command are as follows:
.RS
.TP
\fBdisable\fP \fItype\fP [\fBinput\fP|\fBoutput\fP]
Disables the specified type of encryption.  If you omit the input and
output, both input and output are disabled.  To obtain a list of
available types, use the
.B encrypt disable \&?
command.
.TP
\fBenable\fP \fItype]fP [\fBinput\fP|\fBoutput\fP]
Enables the specified type of encryption.  If you omit input and output,
both input and output are enabled.  To obtain a list of available types,
use the
.B encrypt enable \&?
command.
.TP
.B input
This is the same as the
.B encrypt start input
command.
.TP
.B \-input
This is the same as the
.B encrypt stop input
command.
.TP
.B output
This is the same as the
.B encrypt start output
command.
.TP
.B \-output
This is the same as the
.B encrypt stop output
command.
.TP
\fBstart\fP [\fBinput\fP|\fBoutput\fP]
Attempts to start encryption.  If you omit
.B input
and
.BR output ,
both input and output are enabled.  To obtain a list of available types,
use the
.B encrypt enable \&?
command.
.TP
.B status
Lists the current status of encryption.
.TP
\fBstop\fP [\fBinput\fP|\fBoutput\fP]
Stops encryption.  If you omit input and output, encryption is on both
input and output.
.TP
\fBtype\fP \fItype\fP
Sets the default type of encryption to be used with later
.B encrypt start
or
.B encrypt stop
commands.
.RE
.TP
\fBenviron\fP \fIarguments ...\fP
The
.B environ
command is used to manipulate the the variables that my be sent through
the
.SM TELNET ENVIRON
option.  The initial set of variables is taken from the users
environment, with only the
.SM DISPLAY
and
.SM PRINTER
variables being exported by default.  The
.SM USER
variable is also exported if the
.B \-a
or
.B \-l
options are used.
.PP
Valid arguments for the
.B environ
command are:
.RS
.TP
\fBdefine\fP \fIvariable value\fP
Define the variable
.I variable
to have a value of
.IR value .
Any variables defined by this command are automatically exported.  The
.I value
may be enclosed in single or double quotes so that tabs and spaces may
be included.
.TP
\fBundefine\fP \fIvariable\fP
Remove
.I variable
from the list of environment variables.
.TP
\fBexport\fP \fIvariable\fP
Mark the variable
.I variable
to be exported to the remote side.
.TP
\fBunexport\fP \fIvariable\fP
Mark the variable
.I variable
to not be exported unless explicitly asked for by the remote side.
.TP
.B list
List the current set of environment variables.  Those marked with a \&*
will be sent automatically; other variables will only be sent if
explicitly requested.
.TP
.B \&?
Prints out help information for the
.B environ
command.
.RE
.TP
.B logout
Sends the
.SM TELNET LOGOUT
option to the remote side.  This command is similar to a
.B close
command; however, if the remote side does not support the
.SM LOGOUT
option, nothing happens.  If, however, the remote side does support the
.SM LOGOUT
option, this command should cause the remote side to close the
.SM TELNET
connection.  If the remote side also supports the concept of suspending
a user's session for later reattachment, the logout argument indicates
that you should terminate the session immediately.
.TP
\fBmode\fP \fItype\fP
.I Type
is one of several options, depending on the state of the
.SM TELNET
session.  The remote host is asked for permission to go into the
requested mode.  If the remote host is capable of entering that mode,
the requested mode will be entered.
.RS
.TP
.B character
Disable the
.SM TELNET LINEMODE
option, or, if the remote side does not understand the
.SM LINEMODE
option, then enter ``character at a time'' mode.
.TP
.B line
Enable the
.SM TELNET LINEMODE
option, or, if the remote side does not understand the
.SM LINEMODE
option, then attempt to enter ``old-line-by-line'' mode.
.TP
\fBisig\fP (\fI\-isig\fP)
Attempt to enable (disable) the 
.SM TRAPSIG
mode of the 
.SM LINEMODE
option.  This requires that the
.SM LINEMODE
option be enabled.
.TP
\fBedit\fP (\fB\-edit\fP)
Attempt to enable (disable) the
.SM EDIT
mode of the 
.SM LINEMODE
option.  This requires that the
.SM LINEMODE
option be enabled.
.TP
\fBsofttabs\fP (\fB\-softtabs\fP)
Attempt to enable (disable) the
.SM SOFT_TAB
mode of the 
.SM LINEMODE
option.  This requires that the
.SM LINEMODE
option be enabled.
.TP
\fBlitecho\fP (\fB\-litecho\fP)
Attempt to enable (disable) the 
.SM LIT_ECHO
mode of the 
.SM LINEMODE
option.  This requires that the
.SM LINEMODE
option be enabled.
.TP
.B \&?
Prints out help information for the
.B mode
command.
.RE
.TP
\fBopen\fP \fIhost\fP [\fB-a\fP] [[\fB\-l\fP] \fIuser\fP] [\fB\-\fP\fIport\fP]
Open a connection to the named host.  If no port number is specified,
.B telnet
will attempt to contact a
.SM TELNET
server at the default port.  The host specification may be either a host
name (see
.IR hosts (5)
or an Internet address specified in the ``dot notation'' (see
.IR inet (3).
After establishing a connection, the file
.B \&.telnetrc
in the user's home directory is opened.  Lines beginning with a # are
comment lines.  Blank lines are ignored.  Lines that begin without white
space are the start of a machine entry.  The first thing on the line is
the name of the machine that is being connected to.  The rest of the
line, and successive lines that begin with white space are assumed to be
.B telnet
commands and are processed as if they had been typed in manually to the
.B telnet
command prompt.
.RS
.TP
.B \-a
Attempt automatic login.  This sends the user name via the
.SM USER
variable of the
.SM ENVIRON
option, if supported by the remote system.  The name used is that of the
current user as returned by
.IR getlogin (2)
if it agrees with the current user ID; otherwise it is the name
associated with the user ID.  
.TP
[\fB\-l\fP] \fIuser\fP
may be used to specify the user name to be passed to the remote system
via the
.SM ENVIRON
option.
.TP
\fB\-\fP\fIport\fP
When connecting to a non-standard port,
.B telnet
omits any automatic initiation of
.SM TELNET
options.  When the port number is preceded by a minus sign, the initial
option negotiation is done.
.RE
.TP
.B quit
Close any open
.SM TELNET
session and exit
.BR telnet .
An end of file (in command mode) will also close a session and exit.
.TP
\fBsend\fP \fIarguments\fP
Sends one or more special character sequences to the remote host.  The
following are the arguments which may be specified (more than one
argument may be specified at a time):
.PP
.RS
.TP
.B abort
Sends the
.SM TELNET ABORT
(Abort processes) sequence.
.TP
.B ao
Sends the
.SM TELNET AO
(Abort Output) sequence, which should cause the remote system to flush
all output
.I from
the remote system
.I to
the user's terminal.
.TP
.B ayt
Sends the
.SM TELNET AYT
(Are You There) sequence, to which the remote system may or may not
choose to respond.
.TP
.B brk
Sends the
.SM TELNET BRK
(Break) sequence, which may have significance to the remote system.
.TP
.B ec
Sends the
.SM TELNET EC
(Erase Character) sequence, which should cause the remote system to
erase the last character entered.
.TP
.B el
Sends the
.SM TELNET EL
(Erase Line) sequence, which should cause the remote system to erase the
line currently being entered.
.TP
.B eof
Sends the
.SM TELNET EOF
(End Of File) sequence.
.TP
.B eor
Sends the
.SM TELNET EOR
(End of Record) sequence.
.TP
.B escape
Sends the current
.b telnet
escape character (initially ``^''.
.TP
.B ga
Sends the
.SM TELNET GA
(Go Ahead) sequence, which likely has no significance to the remote
system.
.TP
.B getstatus
If the remote side supports the
.SM TELNET STATUS
command,
.B getstatus
will send the subnegotiation to request that the server send its current
option status.
.TP
.B ip
Sends the
.SM TELNET IP
(Interrupt Process) sequence, which should cause the remote system to
abort the currently running process.
.TP
.B nop
Sends the
.SM TELNET NOP
(No OPeration) sequence.
.TP
.B susp
Sends the
.SM TELNET SUSP
(SUSPend process) sequence.
.TP
.B synch
Sends the
.SM TELNET SYNCH
sequence.  This sequence causes the remote system to discard all
previously typed (but not yet read) input.  This sequence is sent as
.SM TCP
urgent data (and may not work if the remote system is a 4.2BSD system --
if it doesn't work, a lower case ``r'' may be echoed on the terminal).
.TP
\fBdo\fP \fIcmd\fP
.TP
\fBdont\fP \fIcmd\fP
.TP
\fBwill\fP \fIcmd\fP
.TP
\fBwont\fP \fIcmd\fP
Sends the
.SM TELNET DO
.I cmd
sequence.
.I Cmd
can be either a decimal number between 0 and 255, or a symbolic name for
a specific
.SM TELNET
command.
.I Cmd
can also be either
.B help
or
.B \&?
to print out help information, including a list of known symbolic names.
.TP
.B \&?
Prints out help information for the
.B send
command.
.RE
.TP
\fBset\fP \fIargument value\fP 
.TP
\fBunset\fP \fIargument value\fP
The
.B set
command will set any one of a number of
.B telnet
variables to a specific value or to
.SM TRUE.
The special value
.B off
turns off the function associated with the variable; this is equivalent
to using the
.B unset
command.  The
.B unset
command will disable or set to
.SM FALSE
any of the specified functions.  The values of variables may be
interrogated with the
.B display
command.  The variables which may be set or unset, but not toggled, are
listed here.  In addition, any of the variables for the
.B toggle
command may be explicitly set or unset using the
.B set
and
.B unset
commands.
.RS
.TP
.B ayt
If
.B telnet
is in localchars mode, or
.SM LINEMODE
is enabled, and the status character is typed, a
.SM TELNET AYT
sequence (see
.B send ayt
preceding) is sent to the remote host.  The initial value for the "Are
You There" character is the terminal's status character.
.TP
.B echo
This is the value (initially ``^E'') which, when in ``line by line''
mode, toggles between doing local echoing of entered characters (for
normal processing), and suppressing echoing of entered characters (for
entering, say, a password).
.TP
.B eof
If
.B telnet
is operating in
.SM LINEMODE
or ``old line by line'' mode, entering this character as the first
character on a line will cause this character to be sent to the remote
system.  The initial value of the eof character is taken to be the
terminal's
.B eof
character.
.TP
.B erase
If
.B telnet
is in
.b localchars
mode (see
.B toggle localchars
below),
.I and
if
.B telnet
is operating in ``character at a time'' mode, then when this character
is typed, a
.SM TELNET EC
sequence (see
.B send ec
above) is sent to the remote system.  The initial value for the erase
character is taken to be the terminal's
.B erase
character.
.TP
.B escape
This is the
.B telnet
escape character (initially ``^['') which causes entry into
.B telnet
command mode (when connected to a remote system).
.TP
.B flushoutput
If
.B telnet
is in
.B localchars
mode (see
.B toggle localchars
below) and the
.B flushoutput
character is typed, a
.SM TELNET AO
sequence (see
.B send ao
above) is sent to the remote host.  The initial value for the flush
character is taken to be the terminal's
.B flush
character.
.TP
.B forw1
.TP
.B forw2
If
.B telnet
is operating in
.SM LINEMODE,
these are the characters that, when typed, cause partial lines to be
forwarded to the remote system.  The initial value for the forwarding
characters are taken from the terminal's eol and eol2 characters.
.TP
.B interrupt
If
.B telnet
is in
.B localchars
mode (see
.B toggle localchars
below) and the
.B interrupt
character is typed, a
.SM TELNET IP
sequence (see
.B send ip
above) is sent to the remote host.  The initial value for the interrupt
character is taken to be the terminal's
.B intr
character.
.TP
.B kill
If
.B telnet
is in
.B localchars
mode (see
.B toggle localchars
below),
.I and
if
.B telnet
is operating in ``character at a time'' mode, then when this character
is typed, a
.SM TELNET EL
sequence (see
.B send el
above) is sent to the remote system.  The initial value for the kill
character is taken to be the terminal's
.B kill
character.
.TP
.B lnext
If
.B telnet
is operating in
.SM LINEMODE
or ``old line by line'' mode, then this character is taken to be the
terminal's
.B lnext
character.  The initial value for the lnext character is taken to be the
terminal's
.B lnext
character.
.TP
.B quit
If
.B telnet
is in
.B localchars
mode (see
.B toggle localchars
below) and the
.B quit
character is typed, a
.SM TELNET BRK
sequence (see
.B send brk
above) is sent to the remote host.  The initial value for the quit
character is taken to be the terminal's
.B quit
character.
.TP
.B reprint
If
.B telnet
is operating in
.SM LINEMODE
or ``old line by line'' mode, then this character is taken to be the
terminal's
.B reprint
character.  The initial value for the reprint character is taken to be
the terminal's
.B reprint
character.
.TP
.B rlogin
This is the rlogin escape character.  If set, the normal
.B TELNET
escape character is ignored unless it is preceded by this character at
the beginning of a line.  This character, at the beginning of a line
followed by a "."  closes the connection; when followed by a ^Z it
suspends the telnet command.  The initial state is to disable the rlogin
escape character.
.TP
.B start
If the
.SM TELNET TOGGLE-FLOW-CONTROL
option has been enabled, then this character is taken to be the
terminal's
.B start
character.  The initial value for the kill character is taken to be the
terminal's
.B start
character.
.TP
.B stop
If the
.SM TELNET TOGGLE-FLOW-CONTROL
option has been enabled, then this character is taken to be the
terminal's
.B stop
character.  The initial value for the kill character is taken to be the
terminal's
.B stop
character.
.TP
.B susp
If
.B telnet
is in
.B localchars
mode, or
.SM LINEMODE
is enabled, and the
.B suspend
character is typed, a
.SM TELNET SUSP
sequence (see
.B send susp
above) is sent to the remote host.  The initial value for the suspend
character is taken to be the terminal's
.B suspend
character.
.TP
.B tracefile
This is the file to which the output, caused by
.B netdata
or
.B option
tracing being
.SM TRUE,
will be written.  If it is set to ``\fB\-\fP'', then tracing information
will be written to standard output (the default).
.TP
.B worderase
If
.B telnet
is operating in
.SM LINEMODE
or ``old line by line'' mode, then this character is taken to be the
terminal's
.B worderase
character.  The initial value for the worderase character is taken to be
the terminal's
.B worderase
character.
.TP
.B \&?
Displays the legal \fBset\fP (\fBunset\fP) commands.
.RE
.TP
\fBslc\fP \fIstate\fP
The
.B slc
command (Set Local Characters) is used to set or change the state of the
the special characters when the
.SM TELNET LINEMODE
option has been enabled.  Special characters are characters that get
mapped to
.B telnet
commands sequences (like
.B ip
or
.B quit  )
or line editing characters (like
.B erase
and
.BR kill ).
By default, the local special characters are exported.
.RS
.TP
.B check
Verify the current settings for the current special characters.  The
remote side is requested to send all the current special character
settings, and if there are any discrepancies with the local side, the
local side will switch to the remote value.
.TP
.B export
Switch to the local defaults for the special characters.  The local
default characters are those of the local terminal at the time when
.B telnet
was started.
.TP
.B import
Switch to the remote defaults for the special characters.  The remote
default characters are those of the remote system at the time when the
.SM TELNET
connection was established.
.TP
.B \&?
Prints out help information for the
.B slc
command.
.RE
.TP
.B status
Show the current status of
.BR telnet  .
This includes the peer one is connected to, as well as the current mode.
.TP
\fBtoggle\fP \fIarguments ...\fP
Toggle (between
.SM TRUE
and
.SM FALSE)
various flags that control how
.B telnet
responds to events.  These flags may be set explicitly to
.SM TRUE
or
.SM FALSE
using the
.B set
and
.B unset
commands listed above.  More than one argument may be specified.  The
state of these flags may be interrogated with the
.B display
command.  Valid arguments are:
.RS
.TP
.B authdebug
Turns on debugging information for the authentication code.
.TP
.B autoflush
If
.B autoflush
and
.B localchars
are both
.SM TRUE ,
then when the
.BR ao  ,
or
.B quit
characters are recognized (and transformed into
.SM TELNET
sequences; see
.B set
above for details),
.B telnet
refuses to display any data on the user's terminal until the remote
system acknowledges (via a
.SM TELNET TIMING MARK
option) that it has processed those
.SM TELNET
sequences.  The initial value for this toggle is
.SM TRUE
if the terminal user had not done an "stty noflsh", otherwise
.SM FALSE
(see
.BR stty  (1).
.TP
.B autodecrypt
When the
.SM TELNET ENCRYPT
option is negotiated, by default the actual encryption (decryption) of
the data stream does not start automatically.  The autoencrypt
(autodecrypt) command states that encryption of the output (input)
stream should be enabled as soon as possible.
.PP
Note:  Because of export controls, the
.SM TELNET ENCRYPT
option is not supported outside the United States and Canada.
.TP
.B autologin
If the remote side supports the
.SM TELNET AUTHENTICATION
option
.B telnet
attempts to use it to perform automatic authentication.  If the
.SM AUTHENTICATION
option is not supported, the user's login name are propagated through
the
.SM TELNET ENVIRON
option.  This command is the same as specifying the
.B \-a
option on the
.B open
command.
.TP
.B autosynch
If
.B autosynch
and
.B localchars
are both
.SM TRUE,
then when either the
.B intr
or
.B quit
characters is typed (see
.B set
above for descriptions of the
.B intr
and
.B quit
characters), the resulting
.SM TELNET
sequence sent is followed by the
.SM TELNET SYNCH
sequence.  This procedure
.I should
cause the remote system to begin throwing away all previously typed
input until both of the
.SM TELNET
sequences have been read and acted upon.  The initial value of this
toggle is
.SM FALSE.
.TP
.B binary
Enable or disable the
.SM TELNET BINARY
option on both input and output.
.TP
.B inbinary
Enable or disable the
.SM TELNET BINARY
option on input.
.TP
.B outbinary
Enable or disable the
.SM TELNET BINARY
option on output.
.TP
.B crlf
If this is
.SM TRUE,
then carriage returns will be sent as <CR><LF>.  If this is
.SM FALSE,
then carriage returns will be send as <CR><NUL>.  The initial value for
this toggle is
.SM FALSE.
.TP
.B crmod
Toggle carriage return mode.  When this mode is enabled, most carriage
return characters received from the remote host will be mapped into a
carriage return followed by a line feed.  This mode does not affect
those characters typed by the user, only those received from the remote
host.  This mode is not very useful unless the remote host only sends
carriage return, but never line feed.  The initial value for this toggle
is
.SM FALSE .
.TP
.B debug
Toggles socket level debugging (useful only to the \fBsuper user\fP).
The initial value for this toggle is
.SM FALSE .
.TP
.B encdebug
Turns on debugging information for the encryption code.
.TP
.B localchars
If this is
.SM TRUE ,
then the
.BR flush ,
.BR interrupt ,
.BR quit ,
.BR erase ,
and
.B kill
characters (see
.B set
above) are recognized locally, and transformed into (hopefully)
appropriate
.SM TELNET
control sequences (respectively
.BR ao ,
.BR ip ,
.BR brk ,
.BR ec ,
and
.BR el ;
see
.B send
above).  The initial value for this toggle is
.SM TRUE
in ``old line by line'' mode, and
.SM FALSE
in ``character at a time'' mode.  When the
.SM LINEMODE
option is enabled, the value of
.B localchars
is ignored, and assumed to always be
.SM TRUE.
If
.SM LINEMODE
has ever been enabled, then
.B quit
is sent as
.BR abort ,
and
.B eof
and
.B suspend
are sent as
.B eof
and
.BR susp ,
see
.B send
above).
.TP
.B netdata
Toggles the display of all network data (in hexadecimal format).  The
initial value for this toggle is
.SM FALSE.
.TP
.B options
Toggles the display of some internal
.B telnet
protocol processing (having to do with
.SM TELNET
options).  The initial value for this flag is
.SM FALSE .
.TP
.B prettydump
When the
.B netdata
flag is enabled, if
.B prettydump
is enabled the output from the
.B netdata
command will be formatted in a more user-readable format.  Spaces are
put between each character in the output, and the beginning of any
.SM TELNET
escape sequence is preceded by a '*' to aid in locating them.
.TP
.B skiprc
When the skiprc flag is
.SM TRUE,
.SM TELNET
skips the reading of the \&.telnetrc file in the user's home directory
when connections are opened.  The initial value for this flag is
.SM FALSE.
.TP
.B termdata
Toggles the display of all terminal data (in hexadecimal format).  The
initial value for this flag is
.SM FALSE.
.TP
.B verbose_encrypt
When the
.B verbose_encrypt
flag is
.SM TRUE,
.SM TELNET
prints out a message each time encryption is enabled or disabled.  The
initial value for this toggle is
.SM FALSE.
Note:  Because of export controls, data encryption is not supported
outside of the United States and Canada.
.TP
.B \&?
Displays the legal
.B toggle
commands.
.RE
.TP
.B z
Suspend
.BR telnet .
This command only works when the user's shell is
.IR csh (1).
.TP
\fB\&!\fP [\fIcommand\fP]
Execute a single command in a subshell on the local system.  If
.B command
is omitted, then an interactive subshell is invoked.
.TP
\fB\&?\fP \fIcommand\fP
Get help.  With no arguments,
.b telnet
prints a help summary.  If a command is specified,
.b telnet
will print the help information for just that command.
.SH ENVIRONMENT
.B Telnet
uses at least the
.SM HOME,
.SM SHELL,
.SM DISPLAY,
and
.SM TERM
environment variables.  Other environment variables may be propagated to
the other side via the
.SM TELNET ENVIRON
option.
.SH FILES
.TP "\w'~/.telnetrc\ \ 'u"
.TP
~/.telnetrc
user-customized telnet startup values
.sp -1v
.TP
~/.k5login
(on remote host) - file containing Kerberos principals that are allowed
access.
.SH HISTORY
The
.B Telnet
command appeared in 4.2BSD.
.SH NOTES
.PP
On some remote systems, echo has to be turned off manually when in ``old
line by line'' mode.
.PP
In ``old line by line'' mode or
.SM LINEMODE
the terminal's
.B eof
character is only recognized (and sent to the remote system) when it is
the first character on a line.