How to Install Telnet on Fedora Linux


Telnet is a network protocol that allows users to remotely access and manage devices over a Transmission Control Protocol (TCP) network, such as the Internet. Using Telnet on your Fedora system, you can easily connect to remote servers and perform tasks such as managing files, running commands, and configuring settings.

Features of Telnet include:

  • Remote access and control of devices
  • Support for Transmission Control Protocol (TCP) networks
  • Ability to run commands and manage files on remote servers
  • Support for various authentication methods

The following small article will go over quick steps to install Telnet on your Fedora system and some example commands using Telnet.

Step 1: Update Fedora

First, ensure that all existing packages on your Fedora system are up to date by running the following command.

sudo dnf upgrade --refresh

Step 2: Install Telnet

By default, Telnet is on the standard repository of Fedora, making the installation straightforward. In your terminal, run the following command.

sudo dnf install telnet telnet-server

The Telnet service is not enabled to start automatically when the system boots by default. To start the service immediately, use the command.

sudo systemctl start telnet.socket

Once installed, check to ensure the Telnet status is okay with the following command.

systemctl status telnet.socket

Example output:

Step 3: Using Telnet (Command Examples)

With Telnet now installed and activated, Here are some examples of how to use Telnet on a Fedora Linux system via the command line.

Connect to a remote server.

telnet [hostname or IP address] [port]

Example:

telnet example.com 23

Check the status of a remote service.

telnet [hostname or IP address] [port]

Example:

telnet example.com 80

Send a test email using Telnet.

telnet [SMTP server] 25

Example:

telnet smtp.gmail.com 25

Send a test message to a remote server.

telnet [hostname or IP address] [port]

Example:

telnet example.com 6667

Check the connection with a server.

telnet [hostname or IP address] [port]

Example:

telnet example.com 22

Please note that Telnet is considered an insecure protocol, and it is recommended to use SSH instead of Telnet for remote access. Also, after executing the commands, you might need to enter the credentials and follow the instructions provided in the terminal to complete the task. If you plan to use Telnet quite a bit on sensitive networks, you must check out Step 4 about securing Telnet as best as possible.

Step 4: Secure Telnet with FirewallD

Telnet is an insecure protocol, and it is recommended to use SSH instead for remote access. However, if you still want to use Telnet, securing it by blocking unnecessary incoming connections with a firewall is essential. In Fedora Linux, you can configure your firewall with the “firewalld” service.

Here’s an example of how to secure Telnet with firewalld.

Start by checking your firewalld service’s status to ensure it is running.

systemctl status firewalld

If the service is not running, start it with the following command.

sudo systemctl enable firewalld --now

Use the following command to block all incoming connections to the Telnet service.

sudo firewall-cmd --permanent --add-service=telnet

To allow incoming connections to the Telnet service from specific IP addresses or networks, you can use the “–add-source” option. For example, use the following command to allow connections from the IP address 192.168.1.100.

sudo firewall-cmd --permanent --add-service=telnet --add-source=192.168.1.100

After making changes to the firewall, you need to reload the firewall to apply the changes.

firewall-cmd --reload

To list all the services that are allowed in the firewall.

firewall-cmd --list-services

Please note that the above commands are for permanent changes in firewall settings. If you want to make the changes temporarily, you can use the above commands without the –permanent option.

See also
How to Install Remi RPM on Rocky Linux EL9 or EL8

It is important to remember that just using firewalld is not enough. It would be best if you also used other security measures like strong authentication, configuring Telnet to use SSL/TLS, and keeping your system up to date with the latest security patches.

Additional Commands & Tips

Update Telnet

This is straightforward, run the standard DNF update commands as you did at the start of the tutorial. If an update is available, it will be downloaded and installed. Just as a note, there will not be a need to constantly check for Telnet, as its rarely updated and modified.

sudo dnf upgrade --refresh

Remove (Uninstall) Telnet

To remove Telnet from your system, run the following command.

sudo dnf autoremove telnet telnet-server

Conclusion

Installing Telnet on Fedora Linux can provide a convenient way to access and manage devices over a TCP network remotely. However, it is important to proceed cautiously when using Telnet as it is considered an insecure protocol. Telnet sends data, including passwords, in plaintext, which malicious actors can easily intercept. It is recommended to use SSH instead of Telnet for remote access. Additionally, it is essential to secure Telnet by blocking unnecessary incoming connections with a firewall and using strong authentication. It is also necessary to keep your system up to date with the latest security patches. It is essential to be aware of the security risks and take measures to protect your systems and data when using Telnet.

Leave a Comment

Share to...