What is TELNET: Commands, Options and Logins

What is TELNET: Commands, Options and Logins

4 mins read713 Views Comment
Jaya Sharma
Assistant Manager - Content
Updated on Mar 4, 2024 18:38 IST

It is a network protocol that is used for virtually accessing computer and providing two-way text based communication channel between two machines. TELNET follows user command Transmission Control Protocol to create remote sessions.


In this article, we will learn what is TELNET, its commands, options, and types of login.

Table of Contents

What is TELNET?

TELNET (Teletype Network) is a network protocol for enabling computers to connect to local computer. Here, the computer that starts the connection is referred to as the local computer. Here, the computer that accepts the connection is known as a remote computer. Here, the local computer uses the TELNET client program and remote computers use TELNET server program.

It provides access to virtual terminals of remote systems on the LAN or internet. This protocol is used by terminal emulation programs that help us in logging into a remote host. It can be used for the purpose of terminal-to-terminal and interprocess communication. It is used by other protocols for the purpose of establishing protocol control channels.

Telnet Command Lists

  1. open [hostname/IP address] [port]: Connects to a remote host. The port is optional and defaults to 23, the standard port for Telnet.
  2. close: Closes the current connection.
  3. quit: Exits the Telnet client.
  4. display: Shows the current Telnet client settings.
  5. set: Allows you to change the settings of your Telnet session. Some commonly used options with the set command include:
    • set localecho: Displays the characters you type (useful if the server doesn’t echo your input).
    • set term [type]: Sets the terminal type (e.g., ANSI, VT100).
  6. unset: Reverses the effect of the set command for a particular option.
  7. send: Sends special sequences to the Telnet server. Some options include:
    • send break: Sends the BREAK sequence.
    • send interrupt: Sends the IP sequence.
    • send escape: Sends the current escape character.
  8. status: Displays the status of the current Telnet session.
  9. mode [type]: Sets the mode of the Telnet session. Common types include:
    • mode character: Sets character-at-a-time mode.
    • mode line: Sets line-by-line mode.
  10. escape [character]: Sets the escape character (default is Ctrl+]).
  11. log [filename]: Starts logging the Telnet session to a specified file.
  12. ? or help: Displays a list of available Telnet commands.

Command Byte Code

Name Byte code
SE 240
NOP 241
Data Mark 242
Break 243
Interrupt Process 244
Abort output 245
Are you there? 246
Erase character 247
Erase Line 248
Go ahead 249
SB 250
WILL 251
WON’T 252
DO 253
DON’T 254

TELNET Options

The following options are negotiated between client and server:

Item Description
BINARY TRANSMISSION (Used in tn3270 sessions) Transmit characters as binary data.
SUPPRESS GO_AHEAD (The operating system suppresses GO-AHEAD options.) Indicates that when it is in effect on a connection between the data sender and receiver, sender does not need to transmit a GO_AHEAD option. In case the GO_AHEAD option is not required, parties in the connection may suppress it in both directions. This action must take place independently in both directions.
TIMING MARK (Recognized, but has a negative response) Ensures that the previously transmitted data is completely processed.
EXTENDED OPTIONS LIST Extends TELNET option list for 256 other options. Without this option, TELNET option only allows 256 options.
ECHO (User-changeable command) Transmits already received echo data characters back to its original sender.
TERM TYPE Enables server to determine terminal type that is connected to a user TELNET program.
SAK (Secure Attention Key) Establishes an environment that is necessary for secure communication between user and the system.
NAWS (Negotiate About Window Size) Enables clients and server to dynamically negotiate for the window size. This is used by applications that support changing window size.

Types of Login

In TELNET, there are the following types of logins:

Local Login

This type of login occurs whenever a person logs into the local computer. The terminal driver accepts keystrokes that are entered by user when workstation is running a terminal emulator. Here, the terminal driver forwards these characters to the operating system that launches the required application software.

Remote Login 

The user primarily transmits the keystroke to terminal driver, where the operating system only receives but does not understand characters. These characters are then transferred to client that converts these characters into Network Virtual Terminal (NVT) characters. 

After conversion, the client converts them and sends them back to TCP/IP stack. The text in NVT form travels via the internet till it reaches TCP/IP protocol stack on a distant system. The server converts these NVT characters into characters that remote machines can understand.

Explore operating system courses

How Does It Work?

It works in the following steps:

  • Users get a bidirectional interactive text-oriented communication system that utilises a virtual terminal connection over 8 bytes. 
  • The user data is interspersed in-band with TELNET control information over Transmission Control Protocol (TCP). 
  • It is often used on a terminal for executing functions remotely. 
  • Here, users connect to the server using the TELNET protocol. 
  • For this purpose, a command prompt is entered by following the syntax ‘TELNET hostname port’. 
  • The user executes commands on the server using certain commands into the prompt. 
  • For ending a session and logging off, the user terminates a command with TELNET.
What is the OSPF Protocol?
What is the OSPF Protocol?
Have you ever considered how network devices, such as routers, can determine the best (shortest) path for data travel from one device to another? It is because of the OSPF...read more
TCP vs UDP: What’s the Difference?
TCP vs UDP: What’s the Difference?
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are widely used Internet protocols. They are the different methods that specify how data transmits between 2 entities across the internet....read more
Difference between Public and Private IP Address
Difference between Public and Private IP Address
Just as your public home address helps others find you in the physical world, a public IP address acts as a beacon on the internet, allowing devices to communicate with...read more

Limitations of TELNET

The following are the limitations of TELNET:

  • It transmits all information, including usernames and passwords in plaintext due to which it is not recommended for security-sensitive applications.
  • It is vulnerable to a network-based cyberattack which can be exploited to leak information about the server by packet sniffing the banner. If it is improperly configured, then it may be exploited by the malware. 
  • This network protocol does not encrypt any data that is sent over a connection due to which it can be read by attackers in case they have access to hub, switch, router or gateway
  • Many implementations do not have authentication due to which it allows unrestricted access to the system. 
About the Author
Jaya Sharma
Assistant Manager - Content

Jaya is a writer with an experience of over 5 years in content creation and marketing. Her writing style is versatile since she likes to write as per the requirement of the domain. She has worked on Technology, Fina... Read Full Bio