user interface to the TELNET† protocol
telnet [-468EFKLNacdfruxy] [-S tos] [-X authtype] [-e escapechar] [-k realm]
Communicate to a login shell at
host using the TELNET protocol ( or other
Various implemention support many but not necessarily all of the options and commands
host, enters command mode, prompts with
telnet> , accepts and executes commands.
With arguments, it performs an
open with those arguments.
|if the remote system understands the |
user will be sent to the remote system as the value for the variable
May be used with the open command.
| Sets escape character used to invoke command mode . |
ec is omitted, there will be no escape character.
| Stops any character from being recognized as an escape character
|no automatic login to the remote system.
| automatic login. the default, so this option is ignored. |
sends the user name via the
USER variable of the
The name used is that of the current user as returned by getlogin(2) if it agrees with
the current user ID, otherwise it is the name associated with the user ID.
| Forces IPv4 addresses only.
| Forces IPv6 addresses only.
| an 8-bit data path. This causes negotiating the TELNET BINARY option on both input and output.
| an 8-bit data path on output. This causes the BINARY option to be negotiated on output.
| Prevents IP address to name lookup when destination host is given as an IP address.
| Sets the IP type-of-service (TOS) which can
be a numeric or symbolic TOS name found in the |
| Disables the |
atype type of authentication.
| Sets debug toggle to TRUE.
|If Kerberos V5 authentication is being used, local credentials are forwarded to the remote system.
| " " including any credentials that have already been forwarded into the local environment.
|With Kerberos authentication obtain tickets for the remote host in
realm instead of the remote host's realm, as determined by
|Opens tracefile for recording trace information. See the |
|Set the source IP address or a host .
| use AF_UNIX addresses only (e.g., UNIX domain sockets, accessed with a file path).
| Turns on encryption of the data stream . the default, so this option is ignored.
|Suppresses encryption of the data stream.
|name, alias, or the Internet address of a remote host. If |
/, telnet establishes a connection to the corresponding named socket.
| port number (address of an application). If a number is not specified, the default
telnet port (|
This can be used for debugging many protocols since many use a plain text exchange.
telnet host 25 will
host Simple Mail Transport Protocol (SMTP, outgoing email) application which expects commands like
HELP, HELO,EHLO, MAIL FROM, SEND FROM, DATA … ( See nc)
Another example is to test connection to a QL server using
|Disables the reading of |
.telnetrc . See
In rlogin mode, a line of the form
~. disconnects from the remote host; (
~ is the default escape character).
~^Z suspends the session.
~^] escapes to the normal telnet escape prompt.
Once a connection has been opened, enables TELNET LINEMODE . If this
fails, then reverts to one of two input modes: either character at a time or old line
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 (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).
LINEMODE option is enabled, or if
localchars TRUE (the default for old line by
line; see below), the user's quit, intr, and flush characters are trapped locally, and sent as TELNET
protocol sequences to the remote side. If LINEMODE has ever been enabled, then the user's susp and eof
are also sent as TELNET protocol sequences, and quit is sent as a TELNET ABORT instead of BREAK. There
are options (see toggle autoflush and toggle autosynch below) which cause this action to flush subse-
quent output to the terminal (until the remote host acknowledges the TELNET sequence) and flush previ-
ous terminal input (in the case of quit and intr).
While connected to a remote host, command mode may be entered by typing the telnet escape
character (initially ^]). In command mode, the normal terminal editing conventions are available.
Only enough of each command to uniquely identify it need
be typed (also true for arguments to
mode, set, toggle, unset, slc, environ, and display).
A null command returns to connnected host.
open host [-l user] [[-]port]
|name, address in dot notation, or IPv6 coloned-hexadecimal addreess. |
-l login user name passed to the remote system via
port is preceded by a minus sign, the initial option negotiation is done.
When connecting to a port other than 22, no automatic initiation of TELNET options is performed.
After establishing a connection,
.telnetrc in the users home directory is opened.
# $n is replaced by the corresponding argument on the macro invocation command line.
# $i is a loop index . On the first pass '$i' is replaced by arg1 and the macro is executed.
# on the second pass arg2 ...
# use \$ to specify a $
Connected to dapi2.germans.
Escape character is '^]'.
| and return to command mode.
|Sends the TELNET LOGOUT to the remote side, similar to a |
Causes the remote to close the connection.
If the remote side supports suspending a user's session for later reattachment,
logout argument indicates terminate the session immediately.
auth enable|disable type
manipulates the TELNET AUTHENTICATE option.|
To a list of available
auth disable ?
auth disable 'type'
Where 'type' is one of:
| Lists the current status of the various types of authentication.|
encrypt argument …
Not always implementeed
enable type [input | output]
| Omitting |
input or output,
both are disabled.
To list available
encrypt disable ?
stop [input | output]
output both are encrypted.
| Sets the default |
environ args …
Initial variables are populated with: |
USER, PRINTER†, DISPLAY, TERM, COLUMNS, LINES.
USER, PRINTER, DISPLAY are exported by default.
define variable [value]
value is empty, the
value is taken from the environment variable.
variables are exported.
value may be enclosed in apostrophes or quotes.
| Remove |
variable from the list of environment variables.
| Mark |
variable to be exported to the remote side.
| Mark |
variable to not be exported unless explicitly asked for by the
Those marked with |
* will be sent, otherwise only be sent if explicitly requested.
* DISPLAY /private/tmp/com.apple.launchd.juwLU7vO8c/org.macosforge.xquartz:0
| output help for |
| Disable TELNET LINEMODE. enter character at a time mode.
|Enable TELNET LINEMODE or old-line-by-line mode.
|enable (disable) |
|enable (disable) |
| enable (disable) |
| enable (disable) |
| output help for |
send arguments …
| After sending |
arguments, returns to transparent state.
| Are You There reply: |
[ hostname : yes ] or no response
| Break . May invoke |
| Erase Character . Erases the last character entered.
| Erase Line . Erases the line currently being entered.
| End Of File
| End of Record
| current escape character, initially |
^ (since entering it escapes to command prompt).
| Go Ahead
| server current option status.|
RCVD IAC SB STATUS IS
WILL SUPPRESS GO AHEAD
DO TERMINAL TYPE
SB TOGGLE-FLOW-CONTROL ON SE
| No Operation
| Abort processes Sends |
| Abort Output causes the remote system to flush buffered output
|Interrupt Process abort the currently running process.
| SUSPend process |
| discard all previously typed (but not yet read) input. |
sent as TCP urgent data. If ignored a lower case r may be echoed on the terminal.
cmd decimal number between 0 and 255, or a symbolic name for a specific TELNET command.
? to output help information, including a list of known symbolic names.
| outputs help |
display argument ...
| Displays set and toggle values
telnet> display ayt
will flush output when sending interrupt characters.
won't send interrupt characters in urgent mode.
will send login name and/or authentication information.
won't skip reading of ~/.telnetrc file.
won't map carriage return on output.
will recognize certain control characters.
won't turn on socket level debugging.
won't print hexadecimal representation of network traffic.
won't print user readable output for "netdata".
won't show option processing.
won't print hexadecimal representation of terminal traffic.
echo [^E] escape [^]]
tracefile "(standard output)"
flushoutput [^O] interrupt [^C] quit [^\]
eof [^D] erase [^?] kill [^U]
lnext [^V] susp [^Z] reprint [^R]
worderase [^W] start [^Q] stop [^S]
forw1 [off] forw2 [off]
set code value|TRUE|off
unset code value|TRUE|off
variables which may be |
unset, but not
toggle command may be
set or unset
|enters command mode
|in line by line mode, toggles local echo of entered characters (for normal processing), and suppressing echoing (for example when entering, a password)
|in LINEMODE or old line by line mode, as the first character on a line, causes this character to be sent
| ||in LINEMODE, cause partial lines to be forwarded
| in LINEMODE or old line by line mode
| in localchars mode, or LINEMODE , status character. Sends TELNET AYT
| affect input
|in localchars mode and operating in character at a time mode, sends TELNET EC
|^W|| in LINEMODE or old line by line mode,
| affect output
|in localchars mode and operating in character at a time mode, sends TELNET EL
| If TOGGLE-FLOW-CONTROL is enabled
| If TOGGLE-FLOW-CONTROL is enabled
|In localchars mode, sends TELNET AO
| in localchars mode, or LINEMODE is enabled, TELNET SUSP is sent.
|in localchars mode send TELNET IP
| localchars mode sends TELNET BRK
|in LINEMODE or old line by line mode,
|off|| If set, the escape character is ignored unless preceded by this character at the beginning of a line. |
At the beginning of a line followed by a "." closes the connection to be suspended
When followed by a
^Z suspends the telnet command.
|-|| filename to which the output, of |
-, then tracing information is written to standard output
| ||Displays the legal set (unset) commands.
|Set Local Characters|
in LINEMODE Special characters are characters mapped to TELNET commands sequences (like
or line editing characters (like
|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.
Special characters are remote values
| Switch to the local defaults for the special characters. The local default
characters are those of the local terminal at the time when telnet was started.
Special characters are local values
| Switch to the remote defaults for the special characters. The remote default
characters are those of the remote system at the time when the TELNET connection
Special characters are remote default values
|output this help information for the slc command.
|Show the current status of telnet. This includes the peer one is connected to, as well as the current mode.
toggle arguments ...
| use |
unset to explicitly set TRUE or FALSE
More than one argument may be specified. The state of these flags may be interrogated with the display command.
| Turns on debugging for the authentication code.
| If |
localchars are both TRUE, then when the ao, or quit characters are recognized (and transformed into TELNET sequences; telnet 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.
Initaly TRUE if the terminal user had not done an
stty noflsh", otherwise FALSE (see stty
| When the 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.
|If the remote side supports the TELNET AUTHENTICATION option telnet attempts
to use it to perform automatic authentication. If the AUTHENTICATION option
is not supported, the user's login name are propagated through the TELNET
ENVIRON option. This command is the same as specifying -a option on the open command.
| If autosynch and localchars are both TRUE, then when either the intr or quit
characters is typed (see set above for descriptions of the intr and quit characters), the resulting TELNET sequence sent is followed by the TELNET SYNCH
sequence. This procedure should cause the remote system to begin throwing
away all previously typed input until both of the TELNET sequences have been
read and acted upon. |
Enable or disable the TELNET BINARY option on i/o, input, output.
| carriage returns will be sent as ␍␊|
FALSE, then carriage returns will be sent as ␍␀
initially FALSE ␍␀.
|Toggle carriage return mode. |
When enabled, most carriage returns received will be mapped into a carriage return followed by a line feed.
Does not affect those characters typed by the user.
This mode is not very useful unless the remote host only sends carriage return, but never line feed.
|Toggles socket level debugging (useful only to the super user), initally FALSE.
| Turns on debugging information for the encryption code.
|If TRUE, flush, interrupt, quit, erase, and kill characters
are recognized locally, and transformed into
appropriate TELNET control sequences (respectively ao, ip, brk, ec and el
Initially TRUE in old line by line mode, and |
Initially FALSE in character at a time mode.
When LINEMODE is enabled, the value of localchars is ignored, and assumed to always be TRUE.
If LINEMODE has ever been enabled, then quit is sent as abort, and eof and suspend are sent as eof and susp (see send above).
|Toggles the display of terminal data (in hexadecimal ), initially FALSE.
|Toggles the display of network data (in hexadecimal ), initially FALSE.
netdata is enabled, more user readable format, i.e. 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.
|skips the reading of |
.telnetrc, initially FALSE.
|output a message each time encryption is enabled or disabled. initially FALSE.
| Displays toggle commands.
opie sequence challenge
|computes a response to the One time Passwords In Everything (
| Suspend telnet. resume with |
|Execute a single command in a subshell on the local system. |
If command is omitted, then an interactive subshell is invoked.
|Toggles the display of some internal telnet protocol processing, initially FALSE.
| With no arguments, outputs a summary of commands. |
If command is specified, outputs the help information for that command.
Telnet uses 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.
rlogin(1), rsh(1), hosts(5), nologin(5), telnetd(8)
~/.telnetrc user customized telnet startup values
Lines beginning with a # are comment lines. Blank lines are ignored.
Lines that begin without white space are the start of a machine entry.
machine The rest of the line, and successive lines that
begin with white space are telnet commands ..
The telnet command appeared in 4.2BSD.
IPv6 support was added by WIDE/KAME project.
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 eof character is only recognized (and sent to
the remote system) when it is the first character on a line.
/etc/iptos file configures the Type Of Service (TOS) of the Internet
Protocol (IP) used by FTP and Telnet.
The TOS field in the Internet datagram is to specify how the datagram
should be handled. It is a mechanism to allow control information to have
precedence over data.
Generally, protocols that are involved in direct interaction with a human
should select low delay, while data transfers that involve large blocks of
data need high throughput.
Finally, high reliability is most important for
datagram-based Internet management functions.
In the Tru64 UNIX operating system, the ftp and telnet applications and the
ftpd and telnetd daemons allow the configuring of
If the file does not exist, the applications default to recommended by RFC1060:
ftp-control Low delay
ftp-data High throughput
telnet Low delay
Users who want to configure their own TOS values for the TOS field should
provide the /etc/iptos file.
Most IP routers do not differentiate based on TOS, and therefore providing
values other than the default would have no affect. Digital does not
recommend changing the default values for FTP and Telnet.
Application Proto TOS-bits aliases
Items on an entry line are separated by any number of blanks, tabs, or
combination of blanks and tabs. A number sign (#) indicates that the rest
of the line is a comment and is not interpreted by routines that search the
file. Blank lines in the file are ignored.
| The name of an application TOS entry.
| The protocol name for which the entry is appropriate.
| The TOS value to be set for the entry.
| A list of aliases that exist for the entry.
Valid TOS entry names are
ftp-data for FTP and
telnet for Telnet.
The TOS value for the entry should be one of the following hexadecimal
numbers, corresponding to TOS bits:
telent is not included in Apple Mac os
nc) is a tool for connecting to random ports for testing,