The Cybermatic Signal · Fix-it Guides · Devices · Linux
← All guides · Time to fix: 10 minutes per host · Linux
Telnet and rsh are remote-access services from the 1970s and 1980s that send usernames, passwords, and all session data as plain text across the network. Any Linux server still running them — whether inherited from an older admin, spun up from an outdated template, or installed by a package dependency — is exposing credentials to anyone who can see the traffic. The fix takes about ten minutes per host.
The fix, verified
Telnet/rsh legacy remote-access service present
| Severity | critical · Linux |
| Or run | sudo systemctl disable --now telnet.socket rsh.socket 2>/dev/null; sudo apt remove telnetd rsh-server 2>/dev/null || sudo dnf remove telnet-server rsh-server |
| Maps to | CIS Linux 2.2.2HIPAA 164.312(e) |
Telnet (port 23) and rsh (port 514) let users log in and run commands on a remote machine. Unlike SSH, neither service encrypts anything. Every keystroke, including the password typed at login, travels across the wire in a form that any network tap, misconfigured switch port, or compromised router can read directly. On a flat office network or a cloud VPC with shared subnets, that is a realistic risk, not a theoretical one.
A concrete scenario: a developer connects to an internal build server over Telnet from a shared Wi-Fi segment. A second machine on the same segment runs a passive packet capture. Within seconds the capture file contains the developer's username and password in readable text. If that password is reused elsewhere — and it usually is — the attacker now has a starting point for lateral movement.
Run the following commands to see whether the services are installed and whether the sockets are active:
If any of those return results, the service is present and should be removed.
The single command below stops the sockets immediately, disables them from starting at boot, and removes the server packages. It handles both Debian-family and RHEL-family systems by trying apt first and falling back to dnf. Run it as root or with sudo:
sudo systemctl disable --now telnet.socket rsh.socket 2>/dev/null; sudo apt remove telnetd rsh-server 2>/dev/null || sudo dnf remove telnet-server rsh-server
After the command completes, re-run the status and port checks above to confirm nothing is listening on ports 23 or 514. If SSH is not already installed and tested, install and verify it before closing your current session — openssh-server on Debian/Ubuntu or openssh-server on RHEL — so you do not lose remote access.
Older network equipment, industrial control systems, and some legacy application servers occasionally use Telnet or rsh for management or inter-process communication. Before removing the packages on a production host, check whether any scheduled jobs, monitoring scripts, or application configs reference those services. Search for references with grep -r 'telnet\|rsh' /etc /opt /home before removing. If a legacy device genuinely requires Telnet to function, isolate it on a dedicated VLAN with firewall rules that block all other access, and document it as a known exception with a remediation timeline.
Removing the packages is the most durable fix because a package manager update or a misconfigured Ansible playbook cannot accidentally re-enable a service that is not installed. For fleet management, add a task to your configuration management tool (Ansible, Puppet, Chef, or Salt) that ensures telnetd and rsh-server are absent on every managed host. If you use a CIS-hardened base image, verify the image build pipeline explicitly removes these packages so new instances start clean. Schedule a quarterly check — a simple ss -tlnp | grep -E ':23|:514' across your inventory — to catch any drift. Both CIS Linux Benchmark section 2.2.2 and HIPAA 164.312(e) require that unnecessary network services be disabled, so this check can feed directly into your compliance evidence.
Yes, in most compliance frameworks it does. An installed package can be re-enabled by a misconfiguration, a script, or a package manager operation. Removing the package entirely is the only way to guarantee the service cannot start.
SSH (OpenSSH) is the standard replacement for both. It encrypts the entire session including credentials, supports key-based authentication, and is available on every major Linux distribution by default.
No. rsync uses SSH as its transport by default and does not depend on the rsh-server package. The rsh-server package provides only the rshd and rexecd daemons, which are separate from the rsh client utility and from rsync.
Is this open in your environment?
Cybermatic checks for "Telnet/rsh legacy remote-access service present" automatically — on every device, every day — and shows you the exact fix above next to each one it finds. The free scan takes about ten minutes and needs no credit card.
Run the free scan All guides →Part of The Cybermatic Signal. Written by the Cybermatic editorial agent from the configuration check Cybermatic runs for this setting (ID lin-telnet) and reviewed before publication. The click path, command and caution in the fix card are the vendor's documented procedure as of 2026-11-25. Found an error? Write to info@cybermatic.ai.
BriefingIssuesFlashGuidesInsurance checkDomain checkSubscribe
Cybermatic.ai by Ironhawk Group · 9330 Lyndon B Johnson Fwy, Suite 900 · Dallas, TX 75243 · Privacy · cybermatic.ai