[1mSYNOPSIS[0m
[1mtelnet [22m[[1m-8[22m] [[1m-E[22m] [[1m-F[22m] [[1m-K[22m] [[1m-L[22m] [[1m-S [4m[22mtos[24m] [[1m-X [4m[22mauthtype[24m] [[1m-a[22m] [[1m-c[22m] [[1m-d[22m]
[[1m-e [4m[22mescapechar[24m] [[1m-f[22m] [[1m-k [4m[22mrealm[24m] [[1m-l [4m[22muser[24m] [[1m-n [4m[22mtracefile[24m] [[1m-r[22m] [[1m-x[22m]
[[4mhost[24m [[4mport[24m]]
[1mDESCRIPTION[0m
The [1mtelnet [22mcommand is used to communicate with another host using the
TELNET protocol. If [1mtelnet [22mis invoked without the [4mhost[24m argument, it
enters command mode, indicated by its prompt ( [1mtelnet>[22m). In this mode,
it accepts and executes the commands listed below. If it is invoked
with arguments, it performs an [1mopen [22mcommand with those arguments.
[1mOPTIONS[0m
[1m-8 [22mSpecify an 8-bit data path. This causes an attempt to negotiate
the TELNET BINARY option on both input and output.
[1m-E [22mStop any character from being recognized as an escape character.
[1m-F [22mforward a [4mforwardable[24m copy of the local credentials to the
remote system.
[1m-K [22mSpecify no automatic login to the remote system.
[1m-L [22mSpecify an 8-bit data path on output. This causes the BINARY
option to be negotiated on output.
[1m-S [4m[22mtos[24m Set the IP type-of-service (TOS) option for the telnet connec-
tion to the value [4mtos,[24m which can be a numeric TOS value (in dec-
imal, 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.
[1m-X [4m[22matype[0m
Disable the [4matype[24m type of authentication.
[1m-a [22mAttempt automatic login. This sends the user name via the USER
variable of the ENVIRON option, if supported by the remote sys-
tem. The name used is that of the current user as returned by
[4mgetlogin[24m(2) if it agrees with the current user ID; otherwise it
is the name associated with the user ID.
[1m-c [22mDisable the reading of the user's [1m.telnetrc [22mfile. (See the [1mtog-[0m
[1mgle skiprc [22mcommand on this man page.)
[1m-d [22mSet the initial value of the [1mdebug [22mflag to TRUE
[1m-e [4m[22mescape[24m [4mchar[0m
Set the initial [1mtelnet [22mescape character to [4mescape[24m [4mchar.[24m If
[4mescape[24m [4mchar[24m is omitted, then there will be no escape character.
[1m-f [22mforward a copy of the local credentials to the remote system.
[1m-r [22mSpecify a user interface similar to [4mrlogin[24m(1). In this mode,
the escape character is set to the tilde (~) character, unless
modified by the [1m-e [22moption.
[1m-x [22mTurn on encryption of the data stream. When this option is
turned on, [1mtelnet [22mwill exit with an error if authentication can-
not be negotiated or if encryption cannot be turned on.
[4mhost[24m Indicates the name, alias, or Internet address of the remote
host.
[4mport[24m Indicates a port number (address of an application). If the
port is not specified, the default [1mtelnet [22mport (23) is used.
When in rlogin mode, ~ is the telnet escape character; a line of the
form ~. disconnects from the remote host. Similarly, the line ~^Z sus-
pends the telnet session. The line ~^] escapes to the normal telnet
escape prompt.
Once a connection has been opened, [1mtelnet [22mwill attempt to enable the
TELNET LINEMODE option. If this fails, then [1mtelnet [22mwill revert to one
of two input modes: either ``character at a time'' or ``old line by
line,'' depending on what the remote system supports.
When 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.
In ``character at a time'' mode, most text typed is immediately sent to
the remote host for processing.
In ``old line by line'' mode, all text is echoed locally, and (nor-
mally) 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).
If the LINEMODE option is enabled, or if the [1mlocalchars [22mflag is TRUE
(the default for ``old line by line''; see below), the user's [1mquit[22m,
[1mintr[22m, and [1mflush [22mcharacters are trapped locally, and sent as TELNET pro-
tocol sequences to the remote side. If LINEMODE has ever been enabled,
then the user's [1msusp [22mand [1meof [22mare also sent as TELNET protocol
sequences, and [1mquit [22mis sent as a TELNET ABORT instead of BREAK. There
are options (see [1mtoggle autoflush [22mand [1mtoggle autosynch [22mbelow) which
cause this action to flush subsequent output to the terminal (until the
remote host acknowledges the TELNET sequence) and flush previous termi-
nal input (in the case of [1mquit [22mand [1mintr[22m).
[1mdisable [4m[22mtype[0m
Disables the specified type of authentication. To obtain
a list of available types, use the [1mauth disable ? [22mcom-
mand.
[1menable [4m[22mtype[0m
Enables the specified type of authentication. To obtain
a list of available types, use the [1mauth enable ? [22mcom-
mand.
[1mstatus [22mLists the current status of the various types of authen-
tication.
[1mclose [22mClose a TELNET session and return to command mode.
[1mdisplay [4m[22margument[24m [4m...[0m
Displays some or all of the [1mset [22mand [1mtoggle [22mvalues (see below).
[1mencrypt [4m[22margument[24m [4m...[0m
The encrypt command manipulates the information sent through the
TELNET ENCRYPT option.
Note: Because of export controls, the TELNET ENCRYPT option is not
supported outside of the United States and Canada.
Valid arguments for the encrypt command are as follows:
[1mdisable [4m[22mtype[24m [[1minput[22m|[1moutput[22m]
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 [1mencrypt dis-[0m
[1mable ? [22mcommand.
[1menable [4m[22mtype]fP[24m [4m[[24m[1minput[4m[22m|[24m[1moutput[4m[22m][0m
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 [1mencrypt enable[0m
[1m? [22mcommand.
[1minput [22mThis is the same as the [1mencrypt start input [22mcommand.
[1m-input [22mThis is the same as the [1mencrypt stop input [22mcommand.
[1moutput [22mThis is the same as the [1mencrypt start output [22mcommand.
[1m-output[0m
This is the same as the [1mencrypt stop output [22mcommand.
[1mstart [22m[[1minput[22m|[1moutput[22m]
Attempts to start encryption. If you omit [1minput [22mand [1mout-[0m
[1mput[22m, both input and output are enabled. To obtain a list
my be sent through the TELNET ENVIRON option. The initial set
of variables is taken from the users environment, with only the
DISPLAY and PRINTER variables being exported by default. The
USER variable is also exported if the [1m-a [22mor [1m-l [22moptions are used.
Valid arguments for the [1menviron [22mcommand are:
[1mdefine [4m[22mvariable[24m [4mvalue[0m
Define the variable [4mvariable[24m to have a value of [4mvalue[24m.
Any variables defined by this command are automatically
exported. The [4mvalue[24m may be enclosed in single or double
quotes so that tabs and spaces may be included.
[1mundefine [4m[22mvariable[0m
Remove [4mvariable[24m from the list of environment variables.
[1mexport [4m[22mvariable[0m
Mark the variable [4mvariable[24m to be exported to the remote
side.
[1munexport [4m[22mvariable[0m
Mark the variable [4mvariable[24m to not be exported unless
explicitly asked for by the remote side.
[1mlist [22mList the current set of environment variables. Those
marked with a * will be sent automatically; other vari-
ables will only be sent if explicitly requested.
[1m? [22mPrints out help information for the [1menviron [22mcommand.
[1mlogout [22mSends the TELNET LOGOUT option to the remote side. This command
is similar to a [1mclose [22mcommand; however, if the remote side does
not support the LOGOUT option, nothing happens. If, however,
the remote side does support the LOGOUT option, this command
should cause the remote side to close the 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.
[1mmode [4m[22mtype[0m
[4mType[24m is one of several options, depending on the state of the
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.
[1mcharacter[0m
Disable the TELNET LINEMODE option, or, if the remote
side does not understand the LINEMODE option, then enter
``character at a time'' mode.
[1mline [22mEnable the TELNET LINEMODE option, or, if the remote side
does not understand the LINEMODE option, then attempt to
LINEMODE option. This requires that the LINEMODE option
be enabled.
[1mlitecho [22m([1m-litecho[22m)
Attempt to enable (disable) the LIT_ECHO mode of the
LINEMODE option. This requires that the LINEMODE option
be enabled.
[1m? [22mPrints out help information for the [1mmode [22mcommand.
[1mopen [4m[22mhost[24m [[1m-a[22m] [[[1m-l[22m] [4muser[24m] [[1m-[4m[22mport[24m]
Open a connection to the named host. If no port number is spec-
ified, [1mtelnet [22mwill attempt to contact a TELNET server at the
default port. The host specification may be either a host name
(see [4mhosts[24m(5) or an Internet address specified in the ``dot
notation'' (see [4minet[24m(3). After establishing a connection, the
file [1m.telnetrc [22min 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 succes-
sive lines that begin with white space are assumed to be [1mtelnet[0m
commands and are processed as if they had been typed in manually
to the [1mtelnet [22mcommand prompt.
[1m-a [22mAttempt automatic login. This sends the user name via
the USER variable of the ENVIRON option, if supported by
the remote system. The name used is that of the current
user as returned by [4mgetlogin[24m(2) if it agrees with the
current user ID; otherwise it is the name associated with
the user ID.
[[1m-l[22m] [4muser[0m
may be used to specify the user name to be passed to the
remote system via the ENVIRON option.
[1m-[4m[22mport[24m When connecting to a non-standard port, [1mtelnet [22momits any
automatic initiation of TELNET options. When the port
number is preceded by a minus sign, the initial option
negotiation is done.
[1mquit [22mClose any open TELNET session and exit [1mtelnet[22m. An end of file
(in command mode) will also close a session and exit.
[1msend [4m[22marguments[0m
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):
[1mabort [22mSends the TELNET ABORT (Abort processes) sequence.
[1mel [22mSends the TELNET EL (Erase Line) sequence, which should
cause the remote system to erase the line currently being
entered.
[1meof [22mSends the TELNET EOF (End Of File) sequence.
[1meor [22mSends the TELNET EOR (End of Record) sequence.
[1mescape [22mSends the current [1mtelnet [22mescape character (initially
``^''.
[1mga [22mSends the TELNET GA (Go Ahead) sequence, which likely has
no significance to the remote system.
[1mgetstatus[0m
If the remote side supports the TELNET STATUS command,
[1mgetstatus [22mwill send the subnegotiation to request that
the server send its current option status.
[1mip [22mSends the TELNET IP (Interrupt Process) sequence, which
should cause the remote system to abort the currently
running process.
[1mnop [22mSends the TELNET NOP (No OPeration) sequence.
[1msusp [22mSends the TELNET SUSP (SUSPend process) sequence.
[1msynch [22mSends the TELNET SYNCH sequence. This sequence causes
the remote system to discard all previously typed (but
not yet read) input. This sequence is sent as 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).
[1mdo [4m[22mcmd[0m
[1mdont [4m[22mcmd[0m
[1mwill [4m[22mcmd[0m
[1mwont [4m[22mcmd[0m
Sends the TELNET DO [4mcmd[24m sequence. [4mCmd[24m can be either a
decimal number between 0 and 255, or a symbolic name for
a specific TELNET command. [4mCmd[24m can also be either [1mhelp[0m
or [1m? [22mto print out help information, including a list of
known symbolic names.
[1m? [22mPrints out help information for the [1msend [22mcommand.
[1mset [4m[22margument[24m [4mvalue[0m
[1munset [4m[22margument[24m [4mvalue[0m
terminal's status character.
[1mecho [22mThis is the value (initially ``^E'') which, when in
``line by line'' mode, toggles between doing local echo-
ing of entered characters (for normal processing), and
suppressing echoing of entered characters (for entering,
say, a password).
[1meof [22mIf [1mtelnet [22mis operating in LINEMODE or ``old line by
line'' mode, entering this character as the first charac-
ter 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 [1meof [22mcharacter.
[1merase [22mIf [1mtelnet [22mis in [1mlocalchars [22mmode (see [1mtoggle localchars[0m
below), [4mand[24m if [1mtelnet [22mis operating in ``character at a
time'' mode, then when this character is typed, a TELNET
EC sequence (see [1msend ec [22mabove) is sent to the remote
system. The initial value for the erase character is
taken to be the terminal's [1merase [22mcharacter.
[1mescape [22mThis is the [1mtelnet [22mescape character (initially ``^['')
which causes entry into [1mtelnet [22mcommand mode (when con-
nected to a remote system).
[1mflushoutput[0m
If [1mtelnet [22mis in [1mlocalchars [22mmode (see [1mtoggle localchars[0m
below) and the [1mflushoutput [22mcharacter is typed, a TELNET
AO sequence (see [1msend ao [22mabove) is sent to the remote
host. The initial value for the flush character is taken
to be the terminal's [1mflush [22mcharacter.
[1mforw1[0m
[1mforw2 [22mIf [1mtelnet [22mis operating in LINEMODE, these are the charac-
ters that, when typed, cause partial lines to be for-
warded to the remote system. The initial value for the
forwarding characters are taken from the terminal's eol
and eol2 characters.
[1minterrupt[0m
If [1mtelnet [22mis in [1mlocalchars [22mmode (see [1mtoggle localchars[0m
below) and the [1minterrupt [22mcharacter is typed, a TELNET IP
sequence (see [1msend ip [22mabove) is sent to the remote host.
The initial value for the interrupt character is taken to
be the terminal's [1mintr [22mcharacter.
[1mkill [22mIf [1mtelnet [22mis in [1mlocalchars [22mmode (see [1mtoggle localchars[0m
below), [4mand[24m if [1mtelnet [22mis operating in ``character at a
time'' mode, then when this character is typed, a TELNET
EL sequence (see [1msend el [22mabove) is sent to the remote
system. The initial value for the kill character is
If [1mtelnet [22mis operating in LINEMODE or ``old line by
line'' mode, then this character is taken to be the ter-
minal's [1mreprint [22mcharacter. The initial value for the
reprint character is taken to be the terminal's [1mreprint[0m
character.
[1mrlogin [22mThis is the rlogin escape character. If set, the normal
[1mTELNET [22mescape character is ignored unless it is preceded
by this character at the beginning of a line. This char-
acter, 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.
[1mstart [22mIf the TELNET TOGGLE-FLOW-CONTROL option has been
enabled, then this character is taken to be the
terminal's [1mstart [22mcharacter. The initial value for the
kill character is taken to be the terminal's [1mstart [22mchar-
acter.
[1mstop [22mIf the TELNET TOGGLE-FLOW-CONTROL option has been
enabled, then this character is taken to be the termi-
nal's [1mstop [22mcharacter. The initial value for the kill
character is taken to be the terminal's [1mstop [22mcharacter.
[1msusp [22mIf [1mtelnet [22mis in [1mlocalchars [22mmode, or LINEMODE is enabled,
and the [1msuspend [22mcharacter is typed, a TELNET SUSP
sequence (see [1msend susp [22mabove) is sent to the remote
host. The initial value for the suspend character is
taken to be the terminal's [1msuspend [22mcharacter.
[1mtracefile[0m
This is the file to which the output, caused by [1mnetdata[0m
or [1moption [22mtracing being TRUE, will be written. If it is
set to ``[1m-[22m'', then tracing information will be written to
standard output (the default).
[1mworderase[0m
If [1mtelnet [22mis operating in LINEMODE or ``old line by
line'' mode, then this character is taken to be the ter-
minal's [1mworderase [22mcharacter. The initial value for the
worderase character is taken to be the terminal's
[1mworderase [22mcharacter.
[1m? [22mDisplays the legal [1mset [22m([1munset[22m) commands.
[1mslc [4m[22mstate[0m
The [1mslc [22mcommand (Set Local Characters) is used to set or change
the state of the the special characters when the TELNET LINEMODE
option has been enabled. Special characters are characters that
get mapped to [1mtelnet [22mcommands sequences (like [1mip [22mor [1mquit ) [22mor
line editing characters (like [1merase [22mand [1mkill[22m). By default, the
system at the time when the TELNET connection was estab-
lished.
[1m? [22mPrints out help information for the [1mslc [22mcommand.
[1mstatus [22mShow the current status of [1mtelnet[22m. This includes the peer one
is connected to, as well as the current mode.
[1mtoggle [4m[22marguments[24m [4m...[0m
Toggle (between TRUE and FALSE) various flags that control how
[1mtelnet [22mresponds to events. These flags may be set explicitly to
TRUE or FALSE using the [1mset [22mand [1munset [22mcommands listed above.
More than one argument may be specified. The state of these
flags may be interrogated with the [1mdisplay [22mcommand. Valid argu-
ments are:
[1mauthdebug[0m
Turns on debugging information for the authentication
code.
[1mautoflush[0m
If [1mautoflush [22mand [1mlocalchars [22mare both TRUE , then when the
[1mao[22m, or [1mquit [22mcharacters are recognized (and transformed
into TELNET sequences; see [1mset [22mabove for details), [1mtelnet[0m
refuses to display any data on the user's terminal until
the remote system acknowledges (via a TELNET TIMING MARK
option) that it has processed those TELNET sequences.
The initial value for this toggle is TRUE if the terminal
user had not done an "stty noflsh", otherwise FALSE (see
[1mstty[22m(1).
[1mautodecrypt[0m
When the TELNET ENCRYPT option is negotiated, by default
the actual encryption (decryption) of the data stream
does not start automatically. The autoencrypt (autode-
crypt) command states that encryption of the output
(input) stream should be enabled as soon as possible.
Note: Because of export controls, the TELNET ENCRYPT option is
not supported outside the United States and Canada.
[1mautologin[0m
If the remote side supports the TELNET AUTHENTICATION
option [1mtelnet [22mattempts to use it to perform automatic
authentication. If the AUTHENTICATION option is not sup-
ported, the user's login name are propagated through the
TELNET ENVIRON option. This command is the same as spec-
ifying the [1m-a [22moption on the [1mopen [22mcommand.
[1mautosynch[0m
If [1mautosynch [22mand [1mlocalchars [22mare both TRUE, then when
either the [1mintr [22mor [1mquit [22mcharacters is typed (see [1mset[0m
[1moutbinary[0m
Enable or disable the TELNET BINARY option on output.
[1mcrlf [22mIf this is TRUE, then carriage returns will be sent as
<CR><LF>. If this is FALSE, then carriage returns will
be send as <CR><NUL>. The initial value for this toggle
is FALSE.
[1mcrmod [22mToggle 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 FALSE .
[1mdebug [22mToggles socket level debugging (useful only to the [1msuper[0m
[1muser[22m). The initial value for this toggle is FALSE .
[1mencdebug[0m
Turns on debugging information for the encryption code.
[1mlocalchars[0m
If this is TRUE , then the [1mflush[22m, [1minterrupt[22m, [1mquit[22m, [1merase[22m,
and [1mkill [22mcharacters (see [1mset [22mabove) are recognized
locally, and transformed into (hopefully) appropriate
TELNET control sequences (respectively [1mao[22m, [1mip[22m, [1mbrk[22m, [1mec[22m,
and [1mel[22m; see [1msend [22mabove). The initial value for this tog-
gle is TRUE in ``old line by line'' mode, and FALSE in
``character at a time'' mode. When the LINEMODE option
is enabled, the value of [1mlocalchars [22mis ignored, and
assumed to always be TRUE. If LINEMODE has ever been
enabled, then [1mquit [22mis sent as [1mabort[22m, and [1meof [22mand [1msuspend[0m
are sent as [1meof [22mand [1msusp[22m, see [1msend [22mabove).
[1mnetdata[0m
Toggles the display of all network data (in hexadecimal
format). The initial value for this toggle is FALSE.
[1moptions[0m
Toggles the display of some internal [1mtelnet [22mprotocol pro-
cessing (having to do with TELNET options). The initial
value for this flag is FALSE .
[1mprettydump[0m
When the [1mnetdata [22mflag is enabled, if [1mprettydump [22mis
enabled the output from the [1mnetdata [22mcommand will be for-
matted in a more user-readable format. Spaces are put
between each character in the output, and the beginning
of any TELNET escape sequence is preceded by a '*' to aid
in locating them.
Because of export controls, data encryption is not sup-
ported outside of the United States and Canada.
[1m? [22mDisplays the legal [1mtoggle [22mcommands.
[1mz [22mSuspend [1mtelnet[22m. This command only works when the user's shell
is [4mcsh[24m(1).
[1m! [22m[[4mcommand[24m]
Execute a single command in a subshell on the local system. If
[1mcommand [22mis omitted, then an interactive subshell is invoked.
[1m? [4m[22mcommand[0m
Get help. With no arguments, [1mtelnet [22mprints a help summary. If
a command is specified, [1mtelnet [22mwill print the help information
for just that command.
[1mENVIRONMENT[0m
[1mTelnet [22muses at least the HOME, SHELL, DISPLAY, and TERM environment
variables. Other environment variables may be propagated to the other
side via the TELNET ENVIRON option.
[1mFILES[0m
~/.telnetrc user-customized telnet startup values
~/.k5login (on remote host) - file containing Kerberos princi-
pals that are allowed access.
[1mHISTORY[0m
The [1mTelnet [22mcommand appeared in 4.2BSD.
[1mNOTES[0m
On some remote systems, echo has to be turned off manually when
in ``old line by line'' mode.
In ``old line by line'' mode or LINEMODE the terminal's [1meof[0m
character is only recognized (and sent to the remote system)
when it is the first character on a line.
TELNET(1)
Man(1) output converted with
man2html