Telnet came first. It is a protocol for logging into remote machines over a network, and it works by sending everything as plain text. Your username, your password, every command you type, every line the server sends back: all of it travels across the network unencrypted.
In 1995, that was a real problem. Tatu Ylönen, a Finnish researcher, had his university network sniffed by an attacker who collected passwords. He wrote SSH as a direct response. SSH encrypts the entire session, including the authentication handshake. You cannot read the session by watching the network traffic.
That is the essential difference. Everything else follows from it.
How Telnet actually works
Telnet is defined in RFC 854, published in 1983. The protocol is simple by design: it opens a TCP connection, usually on port 23, and then streams bytes in both directions. The client sends what you type; the server sends back what the shell produces. No framing, no encryption, no authentication beyond whatever the shell prompts you for.
That simplicity made it useful for decades. Network engineers used it to test raw TCP connectivity because the protocol is transparent. You can watch every byte with tcpdump and see exactly what is happening. If something is wrong with a connection, Telnet makes the problem visible.
The problem is that same transparency. A passive observer on any network segment between you and the server can collect everything. Passwords, session output, commands. A tool like Wireshark can do this in seconds on any network where the traffic passes through the observer's interface. On a hub-based LAN (common in the 1990s), every machine on the network could see every other machine's traffic.
The sniffing attack that created SSH
In late 1994, Tatu Ylönen discovered that someone had installed a password sniffer on his university's network. The attack had collected over 200 usernames and passwords. The attacker was sitting on the network passively, collecting credentials as people logged in via Telnet and FTP.
Ylönen spent the next few months designing an encrypted replacement. He released SSH-1 in July 1995. Within a few months it had been downloaded by tens of thousands of users across dozens of countries. By 1996 he had founded SSH Communications Security and was working on the commercial version.
The original protocol, SSH-1, had its own problems. Cryptographic weaknesses were discovered, and it was superseded by SSH-2, which is what all current implementations use. SSH-2 is defined in a set of RFCs published in 2006 and is what you get when you run ssh on any modern system.
What SSH does differently
SSH negotiates an encrypted channel before you send any credentials. It uses a key exchange algorithm (commonly Diffie-Hellman or one of its variants) to establish a shared secret between client and server without transmitting that secret over the network. The session is then encrypted with a symmetric cipher like AES.
It also authenticates the server to you using a host key. This prevents a class of attacks where someone inserts a machine between you and your server to intercept the session. The first time you connect to a new server, SSH shows you the host fingerprint and asks if you trust it:
The authenticity of host '192.168.1.100' can't be established.
ED25519 key fingerprint is SHA256:abc123...
Are you sure you want to continue connecting (yes/no)?
If you say yes, SSH saves the fingerprint. If the fingerprint changes on a future connection, SSH warns you that something changed and refuses to connect. This is the mechanism that protects against man-in-the-middle attacks.
SSH also handles key-based authentication, which is considerably stronger than passwords. Instead of sending a password, your client proves it holds the private key that matches a public key on the server, without ever transmitting the private key itself. The server sends a cryptographic challenge; the client signs it with the private key; the server verifies the signature. Your private key never leaves your machine. See our RSA vs Ed25519 guide for more on how key types compare.
What Telnet is still used for
Telnet is not completely dead. Network engineers still use it in a specific way: to test whether a TCP port is open and responding.
telnet google.com 80
That command opens a raw TCP connection to port 80. If it connects, you know the port is open and the firewall is not blocking it. You can even type an HTTP request by hand and see the response. This is a debugging technique, not a security one.
Most people use nc (netcat) or curl for this now, but Telnet still appears in older documentation and on systems where netcat is not installed. It is one of those tools that has outlived its primary use case but remains convenient for a secondary one.
Some older embedded systems and network devices ship with Telnet enabled because they were manufactured before SSH was widely supported, or because the manufacturer never updated the firmware. Industrial control systems, older printers, managed switches from the late 1990s and early 2000s. These are known security problems. Generally they should not be exposed to the internet or to networks where an attacker could reach them.
There is also a narrow use case in completely isolated, air-gapped lab environments where the convenience of no encryption overhead matters and physical security guarantees that no passive observer exists. This is rare and typically in specialized research contexts.
Should you ever use Telnet for remote login?
No. There is no situation where connecting to a live server with Telnet is preferable to SSH. Even on an internal network, password sniffing is possible if any device on that network is compromised. The assumption that your internal network is trustworthy is one that attackers depend on.
If you are running a device that only supports Telnet and you cannot install SSH, the right answer is to isolate that device from networks you do not fully control and plan to replace it. Maintaining a Telnet-enabled device on an accessible network is a liability, not an acceptable risk.
The port difference
Telnet uses port 23 by default. SSH uses port 22. This matters in a couple of ways.
First, port 23 is frequently blocked by firewalls and ISPs, including many corporate networks, because Telnet traffic is considered a security risk. Port 22 is generally open because SSH is a standard and expected protocol.
Second, automated scanners on the internet constantly probe port 22 looking for weak SSH configurations. If you run a public SSH server, you will see thousands of failed login attempts per day in your logs. This is background noise on the internet. Changing the SSH port from 22 to something non-standard (a practice sometimes called "security through obscurity") reduces the noise but does not materially improve security. Anyone doing a targeted scan will find your SSH port regardless. The actual defenses are key-based authentication, firewall rules, and tools like fail2ban.
What replaced Telnet in practice
SSH replaced Telnet for interactive remote sessions. Other protocols replaced it for specific use cases.
HTTP and HTTPS replaced Telnet for testing web connectivity. curl -v gives you far more useful output than a raw Telnet connection to port 80.
nc (netcat) replaced Telnet for raw TCP testing because it is more flexible. nc -zv host port tests whether a port is open and exits cleanly.
For industrial and embedded systems, vendors are increasingly shipping SSH support even on resource-constrained hardware. The computational overhead of SSH encryption is minimal on modern hardware. The main holdouts are very old devices where the firmware cannot be updated and the hardware is too slow to handle the crypto.
Connecting over SSH from a browser
If you need SSH access from a device that does not have a terminal client installed, SSHDock runs SSH directly in your browser. It handles key authentication, jump hosts, and works on any device with a modern browser, including phones and tablets.
It does not support Telnet, which is the correct decision.