FedoraRHEL Based

How To Install Telnet on Fedora 42

Install Telnet on Fedora 42

Telnet, despite being an older network protocol, remains a valuable tool for system administrators and IT professionals working with Linux systems. While largely superseded by more secure protocols like SSH, Telnet still serves important purposes in network diagnostics, legacy system access, and specific troubleshooting scenarios. This guide will walk you through installing and configuring Telnet on Fedora 42, ensuring you have the knowledge to implement it correctly and securely.

Understanding Telnet Protocol

Telnet is a command-line tool that enables users to connect to remote servers over TCP/IP networks. It provides a standard method for terminal devices and terminal-oriented processes to interface with each other. The protocol operates on port 23 by default and transmits data in plain text, making it vulnerable to interception.

Despite security concerns, Telnet remains useful for:

  • Testing network services and connectivity
  • Debugging network issues
  • Accessing legacy systems
  • Terminal-to-terminal communication
  • Establishing protocol control channels

Prerequisites for Installing Telnet on Fedora 42

Before proceeding with the installation, ensure your system meets these requirements:

  • A functioning Fedora 42 installation with sufficient system resources
  • Root or sudo privileges to install packages and modify system settings
  • Network connectivity to download required packages
  • Basic understanding of Linux command-line operations
  • Awareness of Telnet’s security limitations

It’s recommended to perform a system update before installation to prevent compatibility issues and ensure you have the latest security patches.

Step-by-Step Installation Guide

Updating Your Fedora 42 System

Begin by updating your system packages to ensure compatibility and security:

sudo dnf clean all
sudo dnf update

This refreshes your package repositories and installs available updates.

Installing Telnet Packages

After updating your system, install both the Telnet client and server packages:

sudo dnf install telnet telnet-server -y

The client allows you to connect to remote Telnet servers, while the server enables other systems to connect to your machine. The -y flag automatically confirms installation prompts.

To verify successful installation, check the installed packages:

rpm -q telnet
rpm -q telnet-server

These commands should return the package names and versions if installation was successful.

Configuring Telnet Service

Enabling the Telnet Service

After installation, you need to start and enable the Telnet service:

sudo systemctl start telnet.socket
sudo systemctl enable telnet.socket

The first command starts the service immediately, while the second ensures it starts automatically when your system boots.

Verify the service status with:

sudo systemctl status telnet.socket

This will display whether the service is active and properly configured.

Understanding Configuration Files

For advanced configurations, you might need to modify these files:

  • /etc/xinetd.d/telnet: Contains Telnet configuration if using xinetd
  • /etc/sysconfig/telnet: Contains environment variables for the Telnet server

If using xinetd, ensure the disabled = no line is present in the configuration file.

Firewall Configuration for Telnet

Fedora 42 comes with a firewall enabled by default that blocks incoming connections. You’ll need to configure it to allow Telnet traffic.

Opening Port 23 for Telnet

Configure your firewall to allow Telnet connections:

sudo firewall-cmd --permanent --add-port=23/tcp
sudo firewall-cmd --reload

The first command opens port 23 (default for Telnet), while the second applies the changes immediately.

Alternatively, you can add the telnet service directly:

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

Verifying Firewall Configuration

Confirm that your firewall is correctly configured:

sudo firewall-cmd --list-all

You should see either “telnet” under services or port 23/tcp listed under ports.

Testing Your Telnet Installation

After installation and configuration, test to ensure everything works properly.

Local Connection Testing

Test the Telnet server by connecting locally:

telnet localhost

If successful, you’ll see a login prompt for your Fedora system.

Remote Connection Testing

To test from another machine, you’ll need your Fedora system’s IP address:

ip addr show

Then, from another computer:

telnet [your-fedora-ip-address]

Replace [your-fedora-ip-address] with your actual IP.

Security Considerations

While Telnet can be useful, its security limitations require careful consideration.

Understanding Risks

Telnet transmits all data, including usernames and passwords, in plain text, making it vulnerable to:

  • Network sniffing
  • Man-in-the-middle attacks
  • Packet capture

For sensitive environments, consider more secure alternatives like SSH whenever possible.

Mitigating Security Concerns

If you must use Telnet, implement these security measures:

  • Restrict Telnet to trusted internal networks
  • Configure firewall rules to limit access to specific IP addresses:
    sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" service name="telnet" accept'
    sudo firewall-cmd --reload
  • Monitor Telnet access logs regularly
  • Consider implementing Telnet over SSL/TLS using Stunnel

Troubleshooting Common Issues

If you encounter problems with your Telnet installation, check these common issues:

Connection Refused Errors

If you receive “Connection refused” when attempting to connect:

  1. Verify the Telnet service is running:
    sudo systemctl status telnet.socket
  2. Check if the system is listening on port 23:
    sudo ss -tuln | grep 23
  3. Ensure your firewall allows Telnet traffic.

IPv4 vs. IPv6 Listening Issues

Sometimes Telnet may only listen on IPv6 and not IPv4:

netstat -nl | grep tcp

If you see it listening only on :::23 but not on 0.0.0.0:23, you may need to modify your configuration files.

SELinux-Related Problems

Fedora’s SELinux can sometimes block Telnet operations. You can temporarily set SELinux to permissive mode for testing:

sudo setenforce 0

Remember to revert with sudo setenforce 1 after testing.

Advanced Configuration Options

For users requiring more sophisticated setups, Fedora 42 offers various advanced configuration options.

Customizing xinetd Settings

If your Telnet service is managed through xinetd, edit its configuration:

sudo nano /etc/xinetd.d/telnet

You can implement controls like:

  • Access restrictions by IP address
  • Time-based access control
  • Connection limits
  • Logging enhancements

Implementing TCP Wrappers

For granular access control, configure /etc/hosts.allow and /etc/hosts.deny:

# In /etc/hosts.allow
in.telnetd: 192.168.1.0/255.255.255.0

# In /etc/hosts.deny
in.telnetd: ALL

This allows connections only from the specified subnet.

Telnet in Production Environments

If you must use Telnet in production, follow these best practices:

  • Document your Telnet configuration thoroughly
  • Implement formal change management procedures
  • Restrict Telnet access to specific network segments
  • Create dedicated accounts for Telnet access
  • Establish robust monitoring and logging
  • Keep Telnet packages updated with security patches

Consider a gradual migration to more secure alternatives where possible.

Congratulations! You have successfully installed Telnet. Thanks for using this tutorial for installing the Telnet on your Fedora 42 Linux system. For additional or useful information, we recommend you check the official Telnet website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button