How-to

Telnet vs SSH: Plain Text vs Encrypted

Telnet and SSH both give you a remote command line, but only SSH protects it. Telnet survives today mostly as a quick way to poke at a TCP port.

What is the main difference?

Encryption. Telnet, specified in 1969 and standardized in RFC 854 in 1983, sends every keystroke and every byte of output as plain text, including your user name and password. Anyone on the path, a shared Wi-Fi network, a compromised router, a curious transit provider, can read it all. SSH encrypts the session, checks the server's identity with a host key and supports key-based logins. For remote administration there is no contest: SSH replaced Telnet in the late 1990s and nothing on a public network should accept Telnet logins today.

How do they compare point by point?

FeatureTelnetSSH
Default port2322
EncryptionNoneStrong, negotiated per session
Server identity checkNoneHost key fingerprint
Login methodsPassword in plain textKeys, passwords, hardware tokens
File transferNoscp, sftp, rsync
Port forwardingNoLocal, remote and dynamic
Installed on our imagesNo serverYes, running at delivery

Is a Telnet server installed on my machine?

No. None of the nine images we install runs a Telnet server, and none should. You reach the machine with SSH using the root password or the keys from the panel. If a security scan ever reports port 23 open on a machine you manage, find the process with ss -tlnp 'sport = :23' and remove the package that provides it.

What is Telnet still good for?

Testing whether a TCP port answers, and speaking simple text protocols by hand. Because the client just opens a raw connection and shows whatever comes back, it is a handy probe. For example, checking that a mail server on another machine greets you:

telnet mx.example.org 25
# 220 mx.example.org ESMTP Postfix
# type QUIT and press Enter to leave

The client is not installed by default on most images. On Debian 13 and Ubuntu install inetutils-telnet; on Rocky Linux and AlmaLinux run dnf install telnet. Press Ctrl+] and type quit to leave a session that does not close by itself.

What modern tools replace even that?

  • nc -vz host 5432 tests a port and exits, reporting success or the error; -w 3 sets a timeout.
  • openssl s_client -connect host:443 -servername host speaks TLS, which Telnet cannot, and shows the certificate chain.
  • curl -v telnet://host:6379 opens a raw TCP session when nc is missing.
  • nmap -Pn -p 22,80,443 host checks many ports at once from the outside.
  • Bash itself can test a port: timeout 3 bash -c '</dev/tcp/203.0.113.25/443' && echo open.

For services behind TLS, which today means most web, mail submission and database connections, the openssl command is the right probe, since a plain Telnet session sees only encrypted bytes after the handshake begins.

Why do some devices still offer Telnet?

Old network switches, industrial controllers and lab equipment sometimes have no SSH server. If you must manage one, keep it on an isolated network and reach that network only through an encrypted path, for example an SSH tunnel with -L or a WireGuard VPN that ends on one of your machines. The Telnet session then runs only on the trusted segment while everything crossing the internet is encrypted. Each of our machines has one public address, so a small box such as E1 works well as that VPN or SSH entry point.

Does SSH cost more resources than Telnet?

Not in any way you would notice. Encryption on modern processors is cheap: every CPU in the catalog accelerates AES in hardware, and an SSH session uses a negligible share of a core. The security gain is enormous and the cost is effectively zero.

Which should I learn first?

SSH, without question. It is how you will reach every server you run. Learn the Telnet client, or better nc, only as a debugging tool. The basics of SSH are on What is SSH?, and the commands worth memorizing are on Everyday SSH commands.

Keep Reading

What is SSH?

The protocol behind every remote login to a Linux box: what it protects, where it came from and what you use it for daily.

Open

SSH vs SSL/TLS

Both encrypt traffic, but SSH runs your admin sessions while TLS protects websites and APIs; here is where each fits.

Open

Everyday SSH commands

The SSH toolkit you will actually use on a server: ssh, ssh-keygen, ssh-copy-id, ssh-agent, scp, sftp, ssh-keyscan and tunnels.

Open

Fix "Connection refused"

Work out why port 22 says no: sshd stopped, wrong port, a firewall reject rule, a loopback-only listener or a machine still installing.

Open

FAQ

Quick Answers

No. Telnet sends everything, including passwords, in plain text. Use SSH for any remote login.

Port 23 by default. SSH uses port 22.

Yes, as a client for testing TCP ports. Install inetutils-telnet on Debian and Ubuntu or telnet on Rocky Linux and AlmaLinux.

nc -vz for plain TCP, openssl s_client for TLS services and nmap for scanning several ports.

No. No image runs a Telnet server; access is by SSH with the root password or your keys.