Jun 26, 2024 5 min read

How to Install Telnet on Debian 12

Install Telnet on Debian 12 with our step-by-step tutorial. Telnet allows remote device access and management using a network protocol.

Install Telnet on Debian 12
Install Telnet on Debian 12
Table of Contents

Choose a different version or distribution

Introduction

Before we begin talking about how to install Telnet on Debian 12, let's briefly understand – What is Telnet?

Telnet is a network protocol that allows users to remotely access and manage devices over a network. It provides a text-based interface for connecting to a remote computer or server. Telnet facilitates communication by establishing a virtual terminal connection, enabling users to execute commands, retrieve data, and perform various administrative tasks.

While Telnet was widely used in the past, its security vulnerabilities have made it less popular today. Nonetheless, it remains a valuable tool in specific situations where secure alternatives are not available.

In this tutorial, you will install Telnet on Debian 12. We will also address a few FAQs on how to install Telnet on Debian 12.

Advantages of Telnet

  1. Remote Access: Telnet allows users to remotely manage devices from anywhere, facilitating convenience and efficiency.
  2. Simplicity: Its text-based interface makes it user-friendly and easily accessible, requiring minimal resources.
  3. Compatibility: Telnet is compatible with a majority of operating systems, allowing seamless connectivity across different platforms.
  4. Flexibility: It enables users to execute commands, transfer files, retrieve data, and perform administrative tasks with ease.
  5. Cost-effective: Telnet does not require any additional software or hardware, making it a cost-effective solution for remote device.

Install Telnet on Debian 12

Step 1: Update Debian Before Telnet Installation

It's crucial to make sure your Debian operating system is up-to-date before installing Telnet. You can obtain the most recent security updates and package enhancements by updating the system. To update and upgrade all currently installed packages on your system, run the following command:

sudo apt update && sudo apt upgrade

Step 2: Install Telnet on Debian via APT Command

The Telnet package is available by default from Debian's repositories and is simple to install with the apt package manager. Run the command below to install the Telnet package:

sudo apt install xinetd telnetd telnet -y

Following installation, you should confirm that the Telnet service is operating as intended. To find out how the Telnet service is doing, use the following command:

systemctl status inetd

Test Telnet Connection on Debian 12

It's time to test the connection after Telnet has been installed successfully. You must establish a Telnet protocol connection to your remote server in order to accomplish this. Run the following command to connect to the remote server (insert your server's IP address in place of 192.168.50.15):

telnet 192.168.50.15

The Telnet prompt should appear if the connection was successful, enabling you to communicate with the remote server. If you have any problems, make sure the IP address is correct and that the remote server is running the Telnet service.

Common Telnet Commands with Debian 12

Step 1: Connecting to a Remote Server

Replace <IP_ADDRESS> with the IP address of the server and <PORT> with the relevant port number to connect to a remote server via Telnet:

telnet <IP_ADDRESS> <PORT>

For instance, you would type the following to establish a connection to a server on port 23, the default Telnet port, that has the IP address 192.168.50.15:

telnet 192.168.50.15 23

Step 2: Navigating the Telnet Interface

You can communicate with the remote server after you've connected. Within the Telnet interface, some frequently used commands are as follows:

Display current options: To see the available options and settings, use the display command:

display

Toggle local echo: To turn on or off local echo, use the toggle command and then local_echo:

toggle local_echo

Send escape character: Sending the Telnet escape character requires pressing the Ctrl + ] keys. Instead of sending commands to the remote server, use this character to send them directly to the Telnet client.

Step 3: Closing the Telnet Connection

You have several choices when it comes to cutting off the connection to the remote server:

Using the escape character: After sending the escape character by pressing Ctrl + ], type quit and hit Enter:

quit

Sending the logout command: You might be able to terminate the connection using the logout command, depending on how the server is configured:

logout

Step 4: Using Telnet to Check Services

Telnet can also be used to determine whether a server is hosting a particular service. For instance, substitute the IP address of the server for <IP_ADDRESS> to see if an HTTP server is operating on port 80:

telnet <IP_ADDRESS> 80

Once connected, send an HTTP request by entering the following command:

GET / HTTP/1.1
Host: <IP_ADDRESS>
Connection: close

Substitute the IP address of the server for <IP_ADDRESS>. An HTTP response will be sent to you if the HTTP server is up and running.

Section 4: Secure Telnet with UFW (Optional)

Step 1: Install and Enable UFW

An intuitive front-end for controlling iptables firewall rules is called Uncomplicated Firewall (UFW). It is intended to preserve iptables' robustness while streamlining firewall configuration. Use the following command on your Debian system to install UFW:

sudo apt install ufw

Use the following command to enable the UFW after the installation is finished:

sudo ufw enable

Step 2: Set Default Policies

All outgoing connections are allowed, and all incoming connections are denied by default when using UFW. Setting up these default policies explicitly is a good idea. Use the following commands to accomplish this:

sudo ufw default deny incoming
sudo ufw default allow outgoing

Step 3: Allow Telnet Connections

You must designate the IP addresses or subnets that are permitted to access your server via Telnet in order to securely accept Telnet connections. Substitute the IP address or subnet you wish to allow access to for <ALLOWED_IP>:

sudo ufw allow from <ALLOWED_IP> to any port 23

For instance, you would run the following to permit connections from the IP address 192.168.1.10:

sudo ufw allow from 192.168.1.10 to any port 23

You would run the following commands to accept connections from a whole subnet, like 192.168.1.0/24:

sudo ufw allow from 192.168.1.0/24 to any port 23

Step 4: Verify UFW Configuration

It is crucial to confirm that the configuration is correct after configuring the firewall rules. Run the following to see the most recent rules and to see UFW's status:

sudo ufw status

Verify that the permitted IP addresses or subnets are as intended and that the output shows the correct rules for your Telnet service.

FAQs to Install Telnet on Debian 12

Is Telnet included in the default Debian 12 installation? 

No, Telnet is not included by default in Debian 12. You need to install it separately.

What are the prerequisites for installing Telnet on Debian 12? 

You need to have root access or be a sudo user to install Telnet. You should also have an active internet connection.

How do I start Telnet after installing it on Debian 12? 

You can start Telnet by typing telnet in the terminal or by using the Telnet command followed by the target IP address or hostname.

Does Telnet require any additional configuration after installation? 

No, Telnet typically does not require any additional configuration. It is ready to use once installed.

Can I use Telnet to connect to both remote hosts and localhost on Debian 12? 

Yes, Telnet allows connections to both remote hosts and localhost on Debian 12.

Does installing Telnet on Debian 12 have any security implications? 

Yes, Telnet is not a secure protocol as it transmits data in plain text. It is recommended to use SSH instead for secure remote access.

Are there any alternatives to Telnet for remote access on Debian 12? 

Yes, SSH (Secure Shell) is a secure alternative to Telnet for remote access and is widely recommended for improved security.

Conclusion

We hope this tutorial helped you understand how to install Telnet on Debian 12.

If you have any queries, please leave a comment below, and we’ll be happy to respond to them for sure.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.