Telnet is a network protocol used to establish a text-based bidirectional interactive communication session between two devices over a network. It was widely used for remote terminal access and management of network devices before more secure protocols like SSH became popular.
To start a Telnet session, a client (Telnet application) establishes a TCP connection to the Telnet server on port 23 (the default Telnet port).
Once the connection is established, the client and server communicate using a simple text-based protocol. The client emulates a terminal, sending commands and receiving responses as if it were directly connected to the server's terminal.
The client sends commands or data to the server, which processes the commands and sends back responses. The server may also send messages or prompts to the client.
When the session is complete, either the client or server can initiate the termination of the Telnet session, closing the TCP connection.
While Telnet is simple and straightforward, it has significant security vulnerabilities. All data, including usernames, passwords, and commands, are sent over the network in plain text, making it susceptible to eavesdropping and interception. As a result, Telnet is generally not recommended for use over untrusted or public networks.