TELNET(1)
๐ธ NAME ๐ธ
TELNET(1) โ General Commands Manual vibes, and bestie, this is the page for telnet, aka your user interface to the TELNET protocol. โจ Itโs giving โclassic network iconโ and weโre gonna read every single bite. ๐ซถ
โจ SYNOPSIS โจ
telnet [-8] [-E] [-F] [-K] [-L] [-S tos] [-X authtype] [-a]
[-b hostalias] [-c] [-d] [-e escapechar] [-f] [-k realm]
[-l user] [-n tracefile] [-r] [-x] [host [port]]
๐ DESCRIPTION ๐
Okay so the telnet command is used to communicate with another host using the TELNET protocol. If telnet is invoked without the host argument, it enters command mode, indicated by its prompt (telnet>). In this mode, it accepts and executes the commands listed below. If it is invoked with arguments, it performs an open command with those arguments. ๐
๐ The options are as follows ๐
-8โ specifies an 8-bit data path. This causes an attempt to negotiate theTELNET BINARYoption on both input and output. ๐ฆ-Eโ stops any character from being recognized as an escape character. no cap.-Fโ if Kerberos V5 authentication is being used, the-Foption allows the local credentials to be forwarded to the remote system, including any credentials that have already been forwarded into the local environment. ๐ฅ-Kโ specifies no automatic login to the remote system.-Lโ specifies an 8-bit data path on output. This causes theBINARYoption to be negotiated on output.-S tosโ sets the IP type-of-service (TOS) option for thetelnetconnection to the valuetos, which can be a numeric TOS value or, on systems that support it, a symbolic TOS name found in the/etc/iptosfile. ๐-X atypeโ disables theatypetype of authentication.-aโ attempt automatic login. Currently, this sends the user name via theUSERvariable of theENVIRONoption if supported by the remote system. The name used is that of the current user as returned bygetlogin(2)if it agrees with the current user ID, otherwise it is the name associated with the user ID. ๐ซถ-b ip_addressโ usesbind(2)on the local socket to bind it to an aliased ip address or to the ip address of another interface than the one naturally chosen byconnect(2). This can be useful when connecting to services which use IP addresses for authentication and reconfiguration of the server is undesirable (or impossible). ๐ญ-cโ disables the reading of the user's.telnetrcfile. (See thetoggle skiprccommand on this man page.) ๐-dโ sets the initial value of thedebugtoggle toTRUE.-e escapecharโ sets the initial telnet escape character toescapechar. Ifescapecharis omitted, then there will be no escape character. ๐-fโ if Kerberos V5 authentication is being used, the-foption allows the local credentials to be forwarded to the remote system.-k realmโ if Kerberos authentication is being used, the-koption requests thattelnetobtain tickets for the remote host in realmrealminstead of the remote host's realm, as determined bykrb_realmofhost(3). ๐๏ธ-l userโ when connecting to the remote system, if the remote system understands theENVIRONoption, thenuserwill be sent to the remote system as the value for the variableUSER. This option implies the-aoption. This option may also be used with theopencommand. ๐-n tracefileโ openstracefilefor recording trace information. See theset tracefilecommand below. ๐-rโ specifies a user interface similar torlogin(1). In this mode, the escape character is set to the tilde (~) character, unless modified by the-eoption. ๐-xโ turns on encryption of the data stream if possible.hostโ indicates the official name, an alias, or the Internet address of a remote host. ๐portโ indicates a port number (address of an application). If a number is not specified, the default telnet port is used. ๐
When in rlogin mode, a line of the form ~. disconnects from the remote host; ~ is the telnet escape character. Similarly, the line ~^Z suspends the telnet session. The line ~^] escapes to the normal telnet escape prompt. ๐ซ
Once a connection has been opened, telnet will attempt to enable the TELNET LINEMODE option. If this fails, 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. ๐ญ
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). ๐
If the LINEMODE option is enabled, or if the localchars toggle is 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 subsequent output to the terminal (until the remote host acknowledges the TELNET sequence) and flush previous terminal input (in the case of quit and intr). ๐ฅ
While connected to a remote host, telnet command mode may be entered by typing the telnet "escape character" (initially "^]"). When in command mode, the normal terminal editing conventions are available. Note that the escape character will return to the command mode of the initial invocation of telnet that has the controlling terminal. Use the send escape command to switch to command mode in subsequent telnet processes on remote hosts. ๐
๐ The following telnet commands are available ๐
Only enough of each command to uniquely identify it need be typed (this is also true for arguments to the mode, set, toggle, unset, slc, environ, and display commands).
auth argument [...]
The auth command manipulates the information sent through the TELNET AUTHENTICATE option. Valid arguments for the auth command are as follows:
disable typeโ disables the specified type of authentication. To obtain a list of available types, use theauth disable ?command. ๐enable typeโ enables the specified type of authentication. To obtain a list of available types, use theauth enable ?command.statusโ lists the current status of the various types of authentication. โจ
close
Close a TELNET session and return to command mode.
display argument [...]
Displays all, or some, of the set and toggle values (see below). ๐
encrypt argument [...]
The encrypt command manipulates the information sent through the TELNET ENCRYPT option.
Valid arguments for the encrypt command are as follows:
disable type [input|output]โ disables the specified type of encryption. If you omitinputandoutput, both input and output are disabled. To obtain a list of available types, use theencrypt disable ?command. ๐enable type [input|output]โ enables the specified type of encryption. If you omitinputandoutput, both input and output are enabled. To obtain a list of available types, use theencrypt enable ?command.inputโ this is the same as theencrypt start inputcommand.-inputโ this is the same as theencrypt stop inputcommand.outputโ this is the same as theencrypt start outputcommand.-outputโ this is the same as theencrypt stop outputcommand.start [input|output]โ attempts to start encryption. If you omitinputandoutput, both input and output are enabled. To obtain a list of available types, use theencrypt enable ?command. ๐ซถstatusโ lists the current status of encryption.stop [input|output]โ stops encryption. If you omitinputandoutput, encryption is on both input and output.type typeโ sets the default type of encryption to be used with laterencrypt startorencrypt stopcommands. ๐
environ arguments [...]
The environ command is used to manipulate the variables that may be sent through the TELNET ENVIRON option. The initial set of variables is taken from the user's environment, with only the DISPLAY, PRINTER, and XAUTHORITY variables being exported by default. The USER variable is also exported if the -a or -l options are used. Additionally, the value of the TERM variable is by default available to be queried by the server. ๐ฑ
Valid arguments for the environ command are:
define variable valueโ define the variablevariableto have a value ofvalue. Any variables defined by this command are automatically exported. The value may be enclosed in single or double quotes so that tabs and spaces may be included. โจundefine variableโ removevariablefrom the list of environment variables. ๐ฆexportvariable โ flags variable as "yes ship this one to the remote side bestie" ๐unexportvariable โ un-flags variable, so it stays home and does NOT get exported.listโ shows you the current roster of environment variables. The tea on the little markers: a*means it gets sent automatically, a+means it only goes if the server explicitly asks for it, and anything else is staying in the vault โ it won't be revealed to the server even if they request it. ๐?โ prints out help info for theenvironcommand.
logout โ sends the TELNET LOGOUT option over to the remote side. It's giving close energy, but with a twist: if the remote side doesn't support the LOGOUT option, literally nothing happens. But if it does support it, this command should make the remote side close the TELNET connection. And if the remote side also does the whole "suspending a user's session for later reattachment" thing, the logout argument is you saying "no, terminate this session right now, immediately, periodt." ๐
mode type โ type is one of several options, depending on what state your TELNET session is in. The remote host gets asked for permission to enter the mode you want. If the remote host can actually do that mode, the requested mode is entered. ๐ค
characterโ disable the TELNET LINEMODE option, or, if the remote side doesn't understand LINEMODE, then enter "character at a time" mode.lineโ enable the TELNET LINEMODE option, or, if the remote side doesn't understand LINEMODE, then attempt to enter "old-line-by-line" mode.isig(-isig) โ attempt to enable (disable) the TRAPSIG mode of the LINEMODE option. Requires that the LINEMODE option be enabled.edit(-edit) โ attempt to enable (disable) the EDIT mode of the LINEMODE option. Requires that the LINEMODE option be enabled.softtabs(-softtabs) โ attempt to enable (disable) the SOFT_TAB mode of the LINEMODE option. Requires that the LINEMODE option be enabled.litecho(-litecho) โ attempt to enable (disable) the LIT_ECHO mode of the LINEMODE option. Requires that the LINEMODE option be enabled.?โ prints out help info for themodecommand.
open host [-l user] [[-] port] โ opens a connection to the named host. If you don't give a port number, telnet will try to hit a TELNET server at the default port. The host can be either a host name (peep hosts(5)) or an Internet address in "dot notation" (peep inet(3)). The -l option lets you specify the user name to pass to the remote system via the ENVIRON option. When you connect to a non-standard port, telnet omits any automatic initiation of TELNET options. When the port number is preceded by a minus sign, the initial option negotiation is done. โจ
After establishing a connection, the file .telnetrc in the user's home directory gets 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 โ use DEFAULT as the machine name to match every connection. The first thing on the line is the name of the machine being connected to. The rest of the line, plus successive lines that begin with white space, are assumed to be telnet commands and get processed as if you'd typed them in manually at the telnet command prompt. ๐ซถ
quit โ close any open TELNET session and exit telnet. An end-of-file (in command mode) will also close a session and exit. ๐
send arguments โ sends one or more special character sequences to the remote host. Here's the full menu of arguments you can specify (and yes, you can stack more than one at a time):
abortโ sends the TELNET ABORT (Abort processes) sequence.aoโ sends the TELNET AO (Abort Output) sequence, which should make the remote system flush all output from the remote system to your terminal.aytโ sends the TELNET AYT (Are You There) sequence. The remote system may or may not choose to respond โ no cap, it's their call.brkโ sends the TELNET BRK (Break) sequence, which may have significance to the remote system.ecโ sends the TELNET EC (Erase Character) sequence, which should make the remote system erase the last character entered.elโ sends the TELNET EL (Erase Line) sequence, which should make the remote system erase the line currently being entered.eofโ sends the TELNET EOF (End Of File) sequence.eorโ sends the TELNET EOR (End of Record) sequence.escapeโ sends the current telnet escape character (initially^]).gaโ sends the TELNET GA (Go Ahead) sequence, which likely has no significance to the remote system. ๐ญgetstatusโ if the remote side supports the TELNET STATUS command,getstatuswill send the subnegotiation to request that the server send its current option status.ipโ sends the TELNET IP (Interrupt Process) sequence, which should make the remote system abort the currently running process.nopโ sends the TELNET NOP (No OPeration) sequence.suspโ sends the TELNET SUSP (SUSPend process) sequence.synchโ sends the TELNET SYNCH sequence. This one makes the remote system discard all previously typed (but not yet read) input. Heads up: it's sent as TCP urgent data, and it may not work if the remote system is a 4.2BSD system โ if it doesn't work, a lower casermay get echoed on your terminal. ๐docmd โ sends the TELNET DO cmd sequence. cmd can be either a decimal number between0and255, or a symbolic name for a specific TELNET command. cmd can also be eitherhelpor?to print out help information, including a list of known symbolic names.dontcmd โ sends the TELNET DONT cmd sequence. cmd can be either a decimal number between0and255, or a symbolic name for a specific TELNET command. cmd can also be eitherhelpor?to print out help information, including a list of known symbolic names.willcmd โ sends the TELNET WILL cmd sequence. cmd can be either a decimal number between0and255, or a symbolic name for a specific TELNET command. cmd can also be eitherhelpor?to print out help information, including a list of known symbolic names.wontcmd โ sends the TELNET WONT cmd sequence. cmd can be either a decimal number between0and255, or a symbolic name for a specific TELNET command. cmd can also be eitherhelpor?to print out help information, including a list of known symbolic names.?โ prints out help info for thesendcommand.
set argument value
unset argument value
The set command sets any one of a number of telnet variables to a specific value, or to TRUE. The special value off turns off the function associated with the variable โ that's equivalent to using the unset command. The unset command disables, or sets to FALSE, any of the specified functions. You can interrogate the values of variables with the display command. ๐
The variables that may be set or unset (but NOT toggled) are listed here. Also, any of the variables for the toggle command can be explicitly set or unset using set and unset.
aytโ if TELNET is inlocalcharsmode, or LINEMODE is enabled, and the status character gets typed, a TELNET AYT sequence (seesend aytabove) is sent to the remote host. The initial value for the "Are You There" character is the terminal's status character.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). ๐คซeofโ if telnet is operating in 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 theeofcharacter is taken to be the terminal's eof character.
okay bestie we're mid-list, no big intro, just vibes and characters ๐
eraseโ if telnet is in localchars mode (peeptoggle localcharsbelow ok) and telnet is doing that "character at a time" thing, then the second you type this char, a TELNET EC sequence (that'ssend ecfrom up above, mwah) gets yeeted to the remote system. The starting value for the erase character is literally whatever your terminal's erase character is. โจescapeโ this is the telnet escape character (starts out as^[) and it's the one that yeets you into telnet command mode while you're connected to a remote system. main character energy honestly ๐flushoutputโ if telnet is in localchars mode (again:toggle localcharsbelow) and you type the flushoutput character, a TELNET AO sequence (send ao, you know her) goes to the remote host. The starting value comes from your terminal's flush character.forw1forw2โ if TELNET is in LINEMODE, these are the characters that, when typed, cause partial lines to be forwarded to the remote system (yes, partial, she's sending the draft ๐ซถ). Starting values come from your terminal'seolandeol2characters.interruptโ if telnet is in localchars mode (seetoggle localcharsbelow, iykyk) and you hit the interrupt character, a TELNET IP sequence (send ip) gets sent to the remote host. Starting value = the terminal'sintrcharacter.killโ if telnet is in localchars mode (seetoggle localcharsbelow) and telnet is in "character at a time" mode, then typing this bad girl sends a TELNET EL sequence (send el) to the remote system. Starting value = the terminal's kill character. lowkey iconic ๐lnextโ if telnet is in LINEMODE orold line by linemode, this character is taken to be the terminal's lnext character. And yes, the starting value is taken to be the terminal's lnext character. she's consistent fr frquitโ if telnet is in localchars mode (again!toggle localcharsbelow!) and you type quit, a TELNET BRK sequence (send brk) gets sent to the remote host. Starting value = the terminal's quit character.reprintโ if telnet is in LINEMODE orold line by linemode, then this character is taken to be the terminal's reprint character. Starting value = the terminal's reprint character. ๐ธrloginโ okay this one's the rlogin escape character. If you set it, the normal TELNET escape character is ignored unless it's preceded by this character at the beginning of a line. This character, at the beginning of a line, followed by a.closes the connection. Followed by a^Z? It suspends the telnet command. The initial state is to have the rlogin escape character disabled. ๐startโ if the TELNET TOGGLE-FLOW-CONTROL option is enabled, this character is taken to be the terminal's start character. Starting value = the terminal's start character.stopโ if the TELNET TOGGLE-FLOW-CONTROL option is enabled, this character is taken to be the terminal's stop character. Starting value = the terminal's stop character. (yes they're a matching set, we love a coordinated duo ๐)suspโ if telnet is in localchars mode, or LINEMODE is enabled, and you type the suspend character, a TELNET SUSP sequence (send susp) goes to the remote host. Starting value = the terminal's suspend character.tracefileโ this is the file where all the output goes whennetdataoroptiontracing is TRUE. Set it to-and the tracing info gets written to standard output instead (and that's the default btw). โญworderaseโ if telnet is in LINEMODE orold line by linemode, this character is taken to be the terminal's worderase character. Starting value = the terminal's worderase character.?โ displays the legalset(unset) commands. short king. thank you for your service ๐ซถ
๐ฆ skey, slc, status & toggle ๐ฆ
skeysequence challenge โ theskeycommand computes a response to the S/Key challenge. Wanna know more about the S/Key system? Go readskey(1), she explains it better than me ngl.slcstate โ theslccommand (Set Local Characters, see what they did there ๐ ) is used to set or change the state of the special characters when the TELNET LINEMODE option has been enabled. And what even are special characters? They're the characters that get mapped to TELNET command sequences (likeiporquit) or to line editing characters (likeeraseandkill). By default, the local special characters are exported. k slay, here's the states:checkโ verify the current settings for the current special characters. The remote side is asked to send all the current special character settings, and if there's any discrepancy with the local side, the local side switches over to the remote value. vibe check, but for characters ๐exportโ switch to the local defaults for the special characters. "Local defaults" = whatever your local terminal had going on at the time telnet was started.importโ switch to the remote defaults for the special characters. "Remote defaults" = whatever the remote system had at the time the TELNET connection was established.?โ prints out help info for theslccommand. ๐
statusโ shows the current status of telnet. This includes the peer you're connected to, plus the current mode. a whole little report card, obsessedtogglearguments [...] โ toggles (between TRUE and FALSE, the classic duo) all the flags that control how telnet responds to events. You can also set these explicitly to TRUE or FALSE using thesetandunsetcommands listed above. You can pass more than one argument, go off ๐. Wanna interrogate the state of these flags? That's what thedisplaycommand is for. Valid arguments are:authdebugโ turns on debugging information for the authentication code. ๐autoflushโ ifautoflushandlocalcharsare both TRUE, then when theaoorquitcharacters get recognized (and transformed into TELNET sequences; seesetabove for the deets), telnet refuses to display any data on your terminal until the remote system acknowledges (via a TELNET TIMING MARK option) that it processed those TELNET sequences. Initial value for this toggle is TRUE if the terminal user hadn't done anstty noflsh, otherwise it's FALSE (seestty(1)). no cap, she will simply not show you anything until she gets her confirmation ๐ซถautodecryptโ when the TELNET ENCRYPT option is negotiated, by default the actual encryption (decryption) of the data stream doesn't start automatically. Theautoencrypt(autodecrypt) command says that encryption of the output (input) stream should be enabled as soon as possible. yeah, the parentheticals are doing a lot of work here, iykyk ๐ญautologinโ if the remote side supports the TELNET AUTHENTICATION option, TELNET attempts to use it to perform automatic authentication. If the AUTHENTICATION option isn't supported, the user's login name are propagated through the TELNET ENVIRON option. This command is the same as specifying a option on theopencommand. โจautosynchโ ifautosynchandlocalcharsare both TRUE, then when either theintrorquitcharacter is typed (seesetabove for the descriptions of theintrandquitcharacters), the resulting TELNET sequence that gets sent is followed by the TELNET SYNCH sequence. This procedure should cause the remote system to start throwing away all previously typed input until both TELNET sequences have been read and acted upon. The initial value of this toggle is FALSE. ๐๏ธbinaryโ enable or disable the TELNET BINARY option on both input and output. both! at once! equal opportunity ๐inbinaryโ enable or disable the TELNET BINARY option on input.outbinaryโ enable or disable the TELNET BINARY option on output.crlfโ if 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>(yes "send", that's what it says, we're keeping it ๐). The initial value for this toggle is FALSE.
crmodโ toggles carriage return mode. When it's enabled, most carriage return characters coming in from the remote host get mapped into a carriage return followed by a line feed. Lowkey important: this mode does not touch the characters you type โ only the ones the remote host sends back. It's not super useful unless the remote host only ever sends carriage returns and never line feeds. Initial value for this toggle isFALSE.debugโ toggles socket level debugging (useful only to the super-user, so like, root energy only ๐). Initial value isFALSE.encdebugโ turns on debugging information for the encryption code.localcharsโ the big one ๐ซถ. If this is TRUE, then the flush, interrupt, quit, erase, and kill characters (seesetabove) are recognized locally, and transformed into (hopefully ๐ญ) appropriate TELNET control sequences โ respectivelyao,ip,brk,ec, andel(seesendabove). Initial value for this toggle isTRUEinold line by line'' mode, and `FALSE` incharacter at a time'' mode. When theLINEMODEoption is enabled, the value oflocalcharsis ignored and assumed to always be TRUE. And ifLINEMODEhas ever been enabled, thenquitis sent asabort, andeofandsuspendare sent aseofandsusp(seesendabove).netdataโ toggles the display of all network data (in hexadecimal format). Initial value isFALSE.optionsโ toggles the display of some internal telnet protocol processing (the stuff having to do with TELNET options). Initial value isFALSE.prettydumpโ when thenetdatatoggle is enabled, ifprettydumpis enabled the output from thenetdatacommand gets formatted in a more user readable format. Spaces go between each character in the output, and the beginning of any TELNET escape sequence is preceded by a'*'to aid in locating them. So cute, so readable โจ.skiprcโ when theskiprctoggle is TRUE, TELNET skips the reading of the.telnetrcfile in the user's home directory when connections are opened. Initial value isFALSE.termdataโ toggles the display of all terminal data (in hexadecimal format). Initial value isFALSE.verbose_encryptโ when theverbose_encrypttoggle is TRUE, telnet prints out a message each time encryption is enabled or disabled. Initial value isFALSE.?โ displays the legal toggle commands. Your little cheat sheet ๐ .
๐ฆ and now the actual commands, not toggles ๐ฆ
zโ suspend telnet. Heads up though: this command only works when the user is usingcsh(1), so if you're on another shell it's just gonna sit there.! [command]โ execute a single command in a subshell on the local system. If command is omitted, then an interactive subshell is invoked (main character energy, you get a whole shell ๐).? [command]โ get help. With no arguments, telnet prints a help summary. If a command is specified, telnet prints the help information for just that command. We love a targeted answer.
๐ธ ENVIRONMENT ๐ธ
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 โ so yeah, your env can literally travel ๐งณ.
๐ FILES ๐
~/.telnetrcโ user customized telnet startup values
๐ HISTORY ๐
The telnet command appeared in 4.2BSD. Ancient. Iconic. Both ๐ซถ.
โญ NOTES โญ
On some remote systems, echo has to be turned off manually when in ``old line by line'' mode. No cap, it just does.
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. So like โ beginning of the line only, bestie, that's the vibe check.
Source routing is not supported yet for IPv6. Not a bug, just a "we haven't gotten there yet" ๐.
okay that's the whole page, you made it ๐ this was the Debian build of TELNET(1), dated February 3, 1994 โ yeah, it's older than most of us, and it's still serving. go forth and telnet responsibly, ily, bye ๐โจ
๐ฆ where this page comes from
- opensuse-leap 16.0: telnet 1.2-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: telnet 1.2-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: telnet 1.2-160000.2.2 ยท BSD-3-Clause
- opensuse-leap 16.0: telnet 1.2-160000.2.2 ยท BSD-3-Clause
- Copyright (c) 1983, 1990, 1993 The Regents of the University of California. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms