How to Install Telnet on Ubuntu 22.04
Choose a different version or distribution
Introduction
Before we begin talking about how to install Telnet on Ubuntu 22.04, let's briefly understand – What is Telnet?
Telnet, a terminal emulation program, serves as a vital tool for connecting computers over TCP/IP networks. It lets users access remote systems on the Internet or local networks by logging in.
This facilitates resource sharing, system configuration, and troubleshooting across different machines, making it invaluable for network administrators, developers, and users seeking remote access. Telnet simplifies remote operations, enabling seamless connectivity and efficient management of multiple devices and servers on a network.
In this tutorial, you will install Telnet on Ubuntu 22.04. We will also address a few FAQs on how to install Telnet on Ubuntu 22.04.
Advantages of Telnet
- Remote management: Easily access and control devices or systems from a distance.
- Simplicity: User-friendly interface ideal for basic tasks.
- Compatibility: Widely supported across various platforms and systems.
- Quick troubleshooting: Efficiently diagnose and resolve network issues.
- Low overhead: Lightweight protocol requiring minimal system resources.
Requirements
- A server running Ubuntu 22.04.
- A user with
sudo
privileges who is not root. - On your server, configure
192.168.0.100
as a static IP address.
Install Telnet Server
The default repository for Ubuntu 20.04 contains the Telnet server package by default. You only need to execute the following command to install it:
sudo apt install telnetd inetutils-telnetd -y
The following command can be used to verify the status of Telnet service after installation is complete:
sudo systemctl status inetd
Output
? inetd.service - Internet superserver
Loaded: loaded (/lib/systemd/system/inetd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-08-04 09:10:22 UTC; 24s ago
Docs: man:inetd(8)
Main PID: 1158 (inetd)
Tasks: 1 (limit: 1114)
CGroup: /system.slice/inetd.service
??1158 /usr/sbin/inetd
Aug 04 09:10:22 ubuntu2204 systemd[1]: Starting Internet superserver...
Aug 04 09:10:22 ubuntu2204 systemd[1]: Started Internet superserver.
Test Telnet Connection from Remote System
Now that it's installed, the Telnet server is open on port 23. Now is the time to link the remote system's Telnet server to it.
Proceed to log into an additional Ubuntu system and execute the subsequent command:
telnet 192.168.0.100
Your username and password will need to be entered. Following a successful authentication, the following output ought to appear:
Output
Trying 192.168.0.100...
Connected to 192.168.0.100.
Escape character is '^]'.
Ubuntu 22.04 LTS
ubuntu2204 login: hitesh
Password:
Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-41-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the 'unminimize' command.
Last login: Mon Jul 25 09:51:42 2022 from 192.168.0.22
Now, you can use Telnet to run any command on the Telnet server.
Use telnet to Test Open Ports
Telnet can also be used to check whether a remote system's ports are open.
For instance, use the following command to test port 80 on the remote system (IP 192.168.0.100
):
telnet 192.168.0.100 80
The following output should appear if port 80 is open:
Output
Trying 192.168.0.100...
Connected to 192.168.0.100.
Escape character is '^]'.
Whether the Telnet service is not operating or port 80 is blocked. The resulting screen should look like this:
Output
Trying 192.168.0.100...
telnet: Unable to connect to remote host: Connection refused
Use Telnet command to test a Mail Server
To test a mail server, you can also make great use of the Telnet command. Establish a Telnet connection to a mail server.
telnet 192.168.0.100 25
In the event that the connection is successful, the other server will respond to you with something like this:
Output
Trying 192.168.0.100...
Connected to 192.168.0.100.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Debian/GNU)
The ehlo
command and your sender domain name can now be used to reply to the server. For instance:
ehlo mydomain.tld
At that point, the mail server will display the methods that it supports.
Output
250-server1.example.com
250-PIPELINING
250-SIZE
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8
250 CHUNKING
Use the command quit to end the connection.
quit
Output
221 2.0.0 Bye
Connection closed by foreign host.
The complete set of commands is as follows:
Output
user@server1:~# telnet 192.168.0.100 25
Trying 192.168.0.100...
Connected to 192.168.0.100.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Debian/GNU)
ehlo mydomain.tld
250-server1.example.com
250-PIPELINING
250-SIZE
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250-SMTPUTF8
250 CHUNKING
quit
221 2.0.0 Bye
Connection closed by foreign host.
user@server1:~#
If you would like to check if your data center or internet service provider has blocked mail services (port 25), you can use this test procedure.
FAQs to Install Telnet on Ubuntu 22.04
Is Telnet secure on Ubuntu 22.04?
Telnet transmits data without encryption, making it insecure. Opt for SSH for enhanced security.
How to check if Telnet is working on Ubuntu 22.04?
Verify by typing telnet
followed by the IP address or domain name.
Are there any Telnet client alternatives on Ubuntu 22.04?
Yes, consider using SSH (Secure Shell) as a secure alternative to Telnet.
Does Ubuntu 22.04 have Telnet pre-installed?
No, Telnet doesn't come pre-installed on Ubuntu 22.04 by default.
Can Telnet be used for file transfers on Ubuntu 22.04?
Telnet lacks built-in file transfer capabilities; use secure methods like SCP or SFTP instead.
Can Telnet be used to troubleshoot network issues on Ubuntu 22.04?
Yes, Telnet helps diagnose network problems by testing connectivity to specific ports.
Can Telnet sessions be recorded on Ubuntu 22.04 for auditing purposes?
Telnet does not natively offer session recording; consider SSH for session logging and auditing.
Conclusion
We hope this tutorial helped you understand how to install Telnet on Ubuntu 22.04.
If you have any queries, please leave a comment below, and we’ll be happy to respond to them for sure.