Replacing Insecure Protocols: Telnet vs SSH, FTP vs SFTP
Understand why cleartext protocols like Telnet, FTP, and HTTP expose credentials and how their encrypted replacements (SSH, SFTP, HTTPS) solve these problems.
The Problem with Cleartext Protocols
Many foundational internet protocols were designed in the 1970s and 1980s when security was not a primary concern. Cleartext protocols transmit all data — including usernames, passwords, and sensitive information — in plaintext over the network. Any device on the same network segment, or any system the packets traverse, can capture and read this traffic with freely available tools like Wireshark. In environments with network switches (which normally isolate traffic between ports), ARP spoofing can redirect traffic to an attacker's system, making cleartext protocols dangerous even on 'internal' networks.
# What an attacker sees on the wire with Telnet
# (captured via Wireshark or tcpdump)
tcpdump -i eth0 -A port 23
# Sample Telnet capture output:
..login: admin..
..password: S3cr3tPa$$...
..$ ls -la /etc/passwd..
# Every keystroke is visible in plaintext
# Credentials, commands, and file contents - all exposedTelnet vs SSH
Telnet (TCP port 23) provides remote command-line access to systems but transmits everything in plaintext. It has no built-in authentication beyond username/password, which are sent unencrypted. SSH (Secure Shell) (TCP port 22) replaces Telnet with an encrypted, authenticated channel. SSH uses asymmetric key exchange to establish a session key, then encrypts all subsequent communication with symmetric encryption. SSH also authenticates the server (preventing server impersonation) and supports public key authentication (passwordless but more secure than passwords) in addition to password authentication.
# SSH connection (encrypted, server authenticated)
ssh admin@192.168.1.10
# SSH key-based authentication (no password)
ssh -i ~/.ssh/id_rsa admin@192.168.1.10
# Generate SSH key pair
ssh-keygen -t ed25519 -C 'admin@company.com'
# Copy public key to server
ssh-copy-id -i ~/.ssh/id_rsa.pub admin@192.168.1.10
# Disable Telnet on network devices (Cisco IOS)
no service telnet
line vty 0 4
transport input ssh
login localAll lessons in this course
- Replacing Insecure Protocols: Telnet vs SSH, FTP vs SFTP
- TLS Versions, Cipher Suites, and Perfect Forward Secrecy
- Secure DNS: DNSSEC and DNS over HTTPS (DoH)
- IPsec, VPN Protocols, and Remote Access Security