How to Install and Use Telnet on Ubuntu 18.04 LTS

Telnet is a terminal emulation program for TCP/IP networks that allows you to access another computer on the Internet or local area network by logging in to the remote system. Telnet is a client-server protocol used to establish a connection to Transmission Control Protocol port number 23. You can also check open ports on a remote system using Telnet.eval(ez_write_tag([[728,90],’howtoforge_com-box-3′,’ezslot_5′,106,’0′,’0′]));

In this tutorial, we will learn how to install and use Telnet on Ubuntu 18.04 LTS server.eval(ez_write_tag([[580,400],’howtoforge_com-medrectangle-3′,’ezslot_2′,121,’0′,’0′]));

WARNING: Telnet is an unencrypted and therefore insecure protocol. This tutorial exists for educational reasons only and not as a recommendation to use Telnet Server on your system. This guide shows you how to install and use Telnet client and server in case you are interested in learning more about that ancient server management protocol or in case you want to use Telnet client to test your mail server. We do NOT recommend to use Telnet (Server) on servers today, especially not when using it over the internet. To manage your server over the network, use SSH instead of Telnet. Using Telnet client is something different, a telnet client is a useful tool to e.g. test your mail or web server as shown below.

  • A server running Ubuntu 18.04 server.
  • A non-root user with sudo privileges.
  • A static IP address configure on your server.

By default, Telnet server package is available in the Ubuntu 18.04 default repository. You can install it by just running the following command:

sudo apt-get install telnetd -y

Once the installation is completed, you can check the status of Telnet service using the following command:

sudo systemctl status inetd


? inetd.service - Internet superserver
   Loaded: loaded (/lib/systemd/system/inetd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-10-08 15:34:15 UTC; 38s ago
     Docs: man:inetd(8)
 Main PID: 2883 (inetd)
    Tasks: 1 (limit: 1114)
   CGroup: /system.slice/inetd.service
           ??2883 /usr/sbin/inetd

Oct 08 15:34:15 ubuntu1804 systemd[1]: Starting Internet superserver...
Oct 08 15:34:15 ubuntu1804 systemd[1]: Started Internet superserver.

Telnet server is now installed and listening on port 23. It’s time to connect Telnet server from the remote system.

Now, log in to other Ubuntu system and run the following command:


You will be asked to enter your username and password. After successfull authentication, you should see the following output:

Connected to
Escape character is '^]'.
Ubuntu 18.04 LTS
ubuntu1804 login: hitesh
Last login: Mon Oct  8 15:41:31 UTC 2018 from localhost.localdomain on pts/2
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-20-generic x86_64)

 * Documentation:
 * Management:
 * Support:

  System information as of Mon Oct  8 15:46:19 UTC 2018

  System load:  0.0               Processes:             108
  Usage of /:   81.7% of 7.81GB   Users logged in:       2
  Memory usage: 28%               IP address for enp0s3:
  Swap usage:   0%

 * Security certifications for Ubuntu!
   We now have FIPS, STIG, CC and a CIS Benchmark.


 * Want to make a highly secure kiosk, smart display or touchscreen?
   Here's a step-by-step tutorial for a rainy weekend, or a startup.


187 packages can be updated.
88 updates are security updates.

[email protected]:~$ 

You can now run any command on Telnet server using Telnet.eval(ez_write_tag([[580,400],’howtoforge_com-medrectangle-4′,’ezslot_1′,108,’0′,’0′]));

You can also use Telnet to test open ports on a remote system.

For example, to test port 80 on the remote system (IP run the following command:

telnet 80

If the port 80 is open, you should see the following output:

Connected to
Escape character is '^]'.

If the port 80 is blocked or service is not running. You should see the following output:

telnet: Unable to connect to remote host: Connection refused
About the Author

Leave a Reply