We earn commission when you buy through affiliate links.
This does not influence our reviews or recommendations.Learn more.
Telnet is a popular internet protocol that lets you connect to a remote computer virtually.
It is an old protocol developed in 1969.
Nowadays, SSH(Secure Shell) has replaced Telnet.
SSH is also a connection communication protocol that lets connection and system administrators connect to remote computers securely.
As for Telnet, it is now predominantly used to troubleshoot and test connection issues.
Learning Telnet commands can help you manage your networks better.
What is Telnet?
Telnet is a data pipe protocol that stands forTeletypeNetwork.
It offers a command-line interface/interpreter to communicate with the remote server.
To facilitate Telnet protocol, you need Telnet Client.
The client enables users to sign in and use applications on remote systems through TCP/IP.
The Telnet client uses a Telnet server utility to carry out the operations.
Note:In the article, when we mention Telnet, it means Telnet Client, if otherwise mentioned.
During its inception in 1969, security was not the main concern when performing web connection tasks.
Thats why Telnet didnt use anyencryption.
As it is not secure, it is also not recommended for connecting to remote clients over TCP/IP internet.
If you do, you expose yourself to hackers that can interrupt unencrypted data.
SSH is a great alternative protocol that offers a secure way to connect to a server remotely.
How does Telnet work?
Visually, the Telnet protocol works as below.
Telnet is a text-oriented communication that creates a bidirectional(client-server protocol) interactive communication system.
It utilizes an eight-byte connection to do the transmission.
Also, you need a keyboard and screen connected to the terminal to use Telnet.
You enter a command from your terminal to connect to a remote computer.
Once connected, Telnet provides you control over the server, including its files and process.
To connect to a remote server, the user should enter Telnet in the command prompt.
The syntax is:
Once successfully connected, you might use the Telnet prompt to enter more Telnet commands.
However, you gotta install or enable it before you could use it.
Just like Windows, Linux also doesnt come pre-installed with Telnet.
To install Telnet in Ubuntu, you better use the following command.
Note:The command differs depending on your Linux distro.
MacOS also supports Telnet.
To install it, you’re gonna wanna use Homebrew.
With Homebrew installed, jot down the following command to install Telnet on MacOS.
Before we proceed, lets take a quick look at Telnet syntax.
Here, theserver/host IP addressis the server you want to connect to.
Theportis the TCP port number.
This means you must know the remote server IP address/name and port number to troubleshoot beforehand.
Troubleshooting web servers
Telnet offers an easy way to test server connectivity.
All you gotta do is connect to the server/host IP address and the port which accepts a connection.
For example, if youre connecting to 23.45.75.22 at port 532, you better launch the following command.
Now, enter the following command.
Itll return the following:
Now, look at the failed give a shot at connecting to a server.
For example, your server IP address is 23.45.47.53, and the port you want to check is 532.
If the command is a success, you will get a blank screen which means the port is open.
Troubleshooting SMTP mail servers
Simple Mail Transfer Protocol(SMTP) manages the communication between mail servers.
you’re able to troubleshoot SMTP servers with Telnet to see if theyre receiving and sending messages.
You send manual message requests to the SMTP server.
If everything is fine, youll get a response.
The QUIT command exit the Telnet session.
All you oughta do is enter the FTP server IP address and connect to port 21.
You are now connected to the server if the attempt is successful.
Otherwise, youll see an error alert.
Troubleshooting SSH
SSH is the modern take on secure connections and replaces Telnet.
you’re able to use Telnet to see if the server is running SSH.
To do so, use the Telnet command with the server IP address and port 22.
Final Words
Telnet is a handy tool in current times.
It lets you successfully troubleshoot online grid connections without relying heavily on more complex tools or command lines.
You may check out this article onhow to resolve telnet command not found error.