---
title: "Telnet vs SSH: what each protects, and how to retire Telnet · CloudSat"
description: "Telnet vs SSH compared: what each sends over the wire, where Telnet still hides on servers and network gear, how to turn it off, and better port tests."
url: https://cloudsat.io/learn/telnet-vs-ssh-and-retiring-telnet
updated: 2026-11-18T12:00:00Z
source: CloudSat (https://cloudsat.io/). Prices in USD.
---

[Security](https://cloudsat.io/learn/topic/server-security)

# Telnet vs SSH: what each protects, and how to retire Telnet

Telnet vs SSH compared: what each sends over the wire, where Telnet still hides on servers and network gear, how to turn it off, and better port tests.

CloudSat team November 18, 2026 6 min read

Telnet and SSH do the same basic job: they give you a command line on another machine. Telnet does it in plain text and trusts whoever answers. SSH encrypts the session, proves the server's identity and carries files and tunnels over the same connection. That comparison was settled long ago. The useful work today is finding where Telnet still runs on equipment you own and replacing it without losing access to the old devices that depend on it.

## Same job, different decades

Telnet is one of the oldest internet protocols, specified in its familiar form in RFC 854 in 1983 and listening on TCP port 23. It was designed for networks where everyone on the wire was trusted, so it has no encryption and no way to check who is on the other end.

SSH appeared in 1995, written by Tatu Ylönen after a password-sniffing attack on his university network. The current protocol, SSH-2, was published as RFCs 4251 to 4254 in 2006 and listens on TCP port 22. OpenSSH, the implementation in almost every Linux distribution, BSD, macOS and current Windows, keeps adding defenses: recent releases default to a hybrid post-quantum key exchange.

## What each one puts on the wire

A Telnet session sends every keystroke and every line of output as readable text. Your user name, your password and the commands you type cross each hop as they are. Anyone who can see the traffic, on shared Wi-Fi, on a compromised router or on a mirrored switch port, can read the session and could alter it, because nothing protects its integrity either. The client also has no way to know it reached the real server.

SSH wraps the session in three layers:

- **Transport.** The two sides agree on keys, the server proves its identity with its host key, and everything afterward is encrypted and integrity-checked. If the host key ever changes, the client stops, as covered in [what to do when the host key changes](https://cloudsat.io/learn/ssh-host-key-changed-warning-fix).
- **User authentication.** Passwords, public keys, certificates or hardware security keys, all sent inside the encrypted channel.
- **Connection.** Several channels share one session: shells, single commands, port forwards, SFTP file transfers and agent forwarding.

## Side by side

|  | Telnet | SSH |
| --- | --- | --- |
| Default port | 23/tcp | 22/tcp |
| Encryption | None | The whole session |
| Server identity | Not checked | Host key, verified by the client |
| Login methods | Password, sent in the clear | Password, keys, certificates, hardware keys |
| Integrity | None, data can be changed in transit | Every packet authenticated |
| File transfer | Needs a separate protocol, usually FTP | SFTP and scp on the same connection |
| Tunnels and jump hosts | No | Yes |
| Standard | RFC 854 (1983) | RFCs 4251 to 4254 (2006), plus later extensions |

## Where Telnet still turns up

On a current Linux server, Telnet is rarely installed. The places it survives are the ones nobody looks at:

- **Network gear.** Older switches, routers and console servers, or newer ones still running a factory configuration that accepts Telnet on their management lines.
- **Embedded devices.** Cameras, video recorders, power distribution units, UPS management cards, printers and industrial controllers. The Mirai botnet of 2016 spread largely by logging in to such devices over Telnet with factory default passwords.
- **Legacy business systems.** IBM mainframes are still reached through TN3270, a Telnet variant that sites often wrap in TLS, and some old line-of-business applications only speak Telnet.
- **Your own automation.** Expect scripts and monitoring checks written years ago against a device that offered nothing else.
- **Habit.** `telnet host 25` as a quick port test, which keeps the client installed and the reflex alive.

## Find it on systems you run

On Linux servers, look for a listener and for the packages that provide one:

```bash
sudo ss -tlnp | grep -E ':(23|2323)\b'      # anything listening on Telnet ports
systemctl list-units --all | grep -i telnet  # socket-activated servers on the RHEL family
dpkg -l | grep -i telnetd                    # Debian and Ubuntu
rpm -q telnet-server                         # RHEL, AlmaLinux, Rocky Linux
```

Also read `/etc/inetd.conf` or `/etc/xinetd.d/` if either exists: older setups start Telnet from a super-server rather than a unit of its own. For network equipment, read each device's running configuration. It states which protocols its management lines accept, which is more reliable than guessing from the outside.

## Switch it off

On a Linux server, stop and disable the service, then remove the package: `telnetd` or `inetutils-telnetd` on Debian and Ubuntu, `telnet-server` on the RHEL family. On CloudSat, a [cloud firewall](https://cloudsat.io/docs/cloud-firewalls) with no rule for port 23 drops Telnet before it reaches the server, whatever is running inside.

On network devices, enable SSH first, test it from a second session, and only then remove Telnet from the management lines. The idea looks like this on two common platforms:

```text
! Cisco IOS, after creating a local admin user and RSA keys
ip ssh version 2
line vty 0 15
 transport input ssh
 login local

# MikroTik RouterOS
/ip service disable telnet
/ip service set ssh address=198.51.100.0/24
```

Some devices cannot do SSH at all, or only an outdated version of it. Contain those instead of leaving them exposed:

1. Put them on a dedicated management network or VLAN that ordinary users and the internet cannot reach.
2. Allow Telnet into that segment from a single jump host only, and reach the jump host itself over SSH or a VPN. Plain text then crosses one short, controlled link.
3. Give each device a unique password, store it in a password manager, and plan its replacement.

## Move old automation to SSH

Scripts that drive Telnet sessions with `expect` usually survive because nobody had time to rewrite them. Most get shorter over SSH, since many devices run a single command without an interactive login:

```bash
ssh -i ~/.ssh/netops admin@198.51.100.2 'show running-config' > switch-01.cfg
```

For a fleet of network devices from several vendors, tools built for the job, such as Ansible's network modules or the Python library Netmiko, handle prompts and paging for you. Give each script its own key and its own account on the device, so you can revoke one without touching the others.

## Stop using telnet as a port tester

Checking whether a port answers is the last everyday use of the telnet client. Better tools ship with every system, and they also show TLS details that telnet cannot. Point them at hosts you run:

```bash
nc -vz 203.0.113.10 443                                   # does the port accept connections?
openssl s_client -connect mail.example.com:465            # TLS service: shows the certificate chain
openssl s_client -starttls smtp -connect mail.example.com:587
curl -v telnet://203.0.113.10:25                          # raw interactive session, like telnet
```

On Windows, PowerShell has the same check built in:

```powershell
Test-NetConnection 203.0.113.10 -Port 443
```

`TcpTestSucceeded : True` means the port accepted the connection. If it says `False`, look at the firewalls between you and the service before you look at the service itself, starting with [what the server really listens on](https://cloudsat.io/learn/list-listening-ports-linux).

## FAQ

### Is Telnet ever acceptable?

Only where nobody else can see the traffic: an isolated lab bench, or the short hop between a jump host and a device on a dedicated management segment. Never across the internet or a shared office network.

### Can Telnet be encrypted?

Telnet over TLS exists, with its own registered port, 992, and TN3270 sessions are often wrapped in TLS. Support is patchy, though, and you still lack SSH's key-based logins, host key checks and tunnels. Use SSH wherever the device offers it.

### Is SSH slower than Telnet?

Not in any way you will notice at a command line. Encryption costs very little on current processors, and SSH can even compress the session on slow links with the `-C` option.

### Should I uninstall the telnet client?

The client alone is not dangerous; logging in with it is. Removing it does help break the port-testing habit, and `nc` or `Test-NetConnection` cover that job better.

**Run it on CloudSat.** Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. [See plans](https://cloudsat.io/plans) or [deploy a server](https://dash.cloudsat.io/console/deploy).

## Keep reading

[All guides in Security](https://cloudsat.io/learn/topic/server-security)

- [SSH host key changed: verify it, then fix the warning](https://cloudsat.io/learn/ssh-host-key-changed-warning-fix): Security SSH host key changed: verify it, then fix the warning 7 min read
- [Change the SSH port without locking yourself out](https://cloudsat.io/learn/change-ssh-port-safely): Security Change the SSH port without locking yourself out 7 min read
- [Check open and listening ports on Linux with ss and lsof](https://cloudsat.io/learn/list-listening-ports-linux): Networking Check open and listening ports on Linux with ss and lsof 6 min read
- [Cloud IAM for small teams: least privilege, MFA and tokens](https://cloudsat.io/learn/cloud-iam-least-privilege-checklist): Security Cloud IAM for small teams: least privilege, MFA and tokens 6 min read
