Telnet is a network protocol used to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. Here’s how you can install and use Telnet on a Linux system. I had to take a long walk in NYC before taking on this one. I assumed Telnet was no longer in use by anybody.
Installing Telnet
The process of installing Telnet depends on the Linux distribution you are using. Here are the commands for some common distributions:
For Debian/Ubuntu-based distributions:
sudo apt update
sudo apt install telnetFor Red Hat/CentOS-based distributions:
sudo yum install telnetFor Arch Linux:
sudo pacman -S inetutilsUsing Telnet in Linux
After installing Telnet, you can use it to connect to remote servers. Here are some common uses:
Basic Telnet Command
To connect to a remote server, use the following syntax:
telnet [hostname or IP address] [port]For example, to connect to example.com on port 80:
telnet example.com 80Example Usage
- Connecting to a Remote Server:
telnet example.com 80If the connection is successful, you will see a blank screen or some welcome message from the server.
- Testing a Mail Server:
You can use Telnet to test an SMTP mail server:
telnet smtp.example.com 25Once connected, you can type SMTP commands such as HELO, MAIL FROM, RCPT TO, and DATA to interact with the mail server.
- Checking an Open Port:
Telnet can be used to check if a particular port is open on a server:
telnet yourserver.com 22If the port is open, you will connect to it, otherwise, you will get a connection error.
Closing a Linux Telnet Session
To close a Telnet session, you can type exit or quit, or you can simply press Ctrl+] to escape to the Telnet prompt and then type quit to exit.
Ctrl + ]
telnet> quitTelnet Commands and Options
- open [hostname] [port]: Open a connection to the specified hostname and port.
- close: Close the current Telnet session.
- quit: Exit the Telnet client.
- status: Print status information.
- ? or help: Display help information.
Security Note
Telnet is not a secure protocol as it transmits data in plaintext, including usernames and passwords. For secure remote access, it is recommended to use SSH (Secure Shell) instead of Telnet.
To install SSH on a Linux system:
For Debian/Ubuntu-based distributions:
sudo apt update
sudo apt install openssh-clientFor Red Hat/CentOS-based distributions:
sudo yum install openssh-clientsFor Fedora:
sudo dnf install openssh-clientsFor Arch Linux:
sudo pacman -S opensshTo connect to a remote server using SSH:
ssh user@hostnameBy following these instructions, you should be able to install and use Telnet on your Linux system. Remember to consider using more secure alternatives like SSH for sensitive communications.

