You can use Telnet to access other systems. These Telnet commands will help you do that.

Start Telnet and establish a con­nec­tion

Telnet is used from the command line, for example, the command prompt on Windows. Only one command is needed to start the client:

telnet

You can also connect directly without starting the client first. To do this, either specify the hostname or establish the con­nec­tion via IP address:

telnet <hostname></hostname>
telnet 127.0.0.1

You will now be asked to enter the access data and will then be connected.

Telnet standard commands

The following overview shows the standard commands. Some of these can be extended with arguments and executed using the Telnet client:

Command Short command De­scrip­tion
?/help ? Opens the help menu
Close c Closes the current Telnet con­nec­tion
display argument d Displays the various para­met­ers for the current con­nec­tion (port, terminal type, etc.)
environ argument Defines the variables for the re­spect­ive operating system en­vir­on­ment
toggle argument De­term­ines how Telnet reacts to certain situ­ations. The command changes the status from TRUE to FALSE or vice versa; using set or unset, the status can also be set directly ⁠— arguments are thus also valid for set/unset
Logout Ter­min­ates the current Telnet session if the remote host supports the logout option
mode type Sets the trans­mis­sion type (text file, binary file)
open hostname o Es­tab­lishes another con­nec­tion to the selected host in addition to the existing one
Quit q Ter­min­ates the Telnet client including all active con­nec­tions
send argument sen Sends selected typical Telnet strings to the host
set argument set Modifies the con­nec­tion para­met­ers
Unset u Loads the pre­defined con­nec­tion para­met­ers
Status st Shows whether the con­nec­tion is active
Tip

Since Telnet is operated from the command line, you should also know other commands. Get to know Windows CMD commands to easily find your way around the command prompt.

Telnet command options

Some commands can be extended by arguments, which means that more options are available to you. Here are some important para­met­ers:

Command Option De­scrip­tion
telnet -d Activates debug mode
-a Attempts automatic login
-n tracefile Opens tracefile to record ap­pro­pri­ate in­form­a­tion (see also ‘set tracefile’)
-l user If the host supports environ, you will be logged in as the specified user.
-e escape char Sets an escape character
-E No character is re­cog­nised as escape character
-x Attempts to activate en­cryp­tion
mode character Disables LINEMODE
Line Enables LINEMODE
isig/-isig Enables/disables the TRAPSIG mode of LINEMODE
edit/-edit Enables/disables the EDIT mode of LINEMODE
softtabs/-softtabs Enables/disables the SOFT_TABS mode of LINEMODE
litecho/-litecho Enables/disables the LIT_ECHO-Modus of LINEMODE
send abort Sends ‘Abort process’ sequence
Ao Sends ‘Abort output’ sequence; the host flushes the output from itself to the client.
ayt Sends ‘Are you there’ sequence; the host can confirm with a response.
brk Sends ‘Break’ sequence
ec Sends ‘Erase character’ sequence; the host erases the last character entered
el Sends Erase line sequence; the host erases the line that is being entered
eof Sends ‘End of file’ sequence
eor Sends ‘End of record’ sequence
esc Sends the current escape character (see also ‘telnet -e’)
ga Sends ‘Go ahead’ sequence
getstatus Requests the host to discard any input that has not yet been processed
? Provides in­form­a­tion about the send command
set/unset echo value De­term­ines whether char­ac­ters entered should also be displayed
(value can be TRUE/FALSE or a special character) eof value Enables the ‘End of file’ character (see also ‘send eof’)
erase value Enables erase character (see also ‘send ec’); works only in lo­c­al­chars mode (see also ‘toggle lo­c­al­chars’)
escape value Enables escape character (see also ‘telnet -e’)
flushout­put value Enables abort output character (see also ‘send ao’); works only in lo­c­al­chars mode (see also ‘toggle lo­c­al­chars’)
lnext value Enables ‘lnext’ char­ac­ters
quit value Enables ‘break’ char­ac­ters (see also ‘send brk’); works only in lo­c­al­chars mode (see also toggle lo­c­al­chars)
reprint value Enables ‘reprint’ character
start value Enables ‘start’ character; only if TOGGLE-FLOW-CONTROL is enabled
stop value Activates ‘stop’ character; only if TOGGLE-FLOW-CONTROL is activated
worderase value Enables ‘worderase’ char­ac­ters
environ define variable value Assigns a value to a variable; values can be enclosed in single or double quotes.
undefine variable Deletes the specified variable
export variable Exports the specified variable
unexport variable Specifies that the specified variable may only be exported when Telnet is spe­cific­ally requested to do so
list Lists all variables; * character indicates whether the variable is exported auto­mat­ic­ally.
? Provides in­form­a­tion about the send command
toggle autosynch If both autosynch and lo­c­al­chars are active, an ad­di­tion­al ‘synch’ sequence is sent when the quit character is sent (see also ‘set quit’)
(Initial state is TRUE) binary Enables/disables ‘binary’ option on input and output
inbinary Enables/disables ‘binary’ option at input
outbinary Enables/disables binary option on output
crlf TRUE: carriage return is set to <CR><LF>
crmod FALSE: carriage return is set to <CR><NUL> (FALSE is the normal state here)
debug Switches the state of the ‘carriage return’ mode
lo­c­al­chars Switches the state of the ‘Socket debug’ mode (FALSE is the normal state here)

For more Telnet commands and options, as well as detailed doc­u­ment­a­tion, check out the Telnet Man Page.

Tip

If you don’t really know the remote protocol yet, it’s worth taking a look at our detailed article on the subject ⁠— telnet. The article also explains how to enable Telnet in Windows.

Go to Main Menu