Telnet vs. SSH: How Is SSH Different From Telnet?

May 20, 2021

Introduction

Telnet and SSH are network protocols used to access and manage remote systems. But what is it that makes them different, and when is it better to use one over the other?

This tutorial covers what Telnet and SSH are, when they are used, and how they work.

Telnet vs SSH

Telnet vs. SSH: Definitions

Telnet (Telecommunications and Networks) and SSH (Secure SHell) are general-purpose client-server applications that allow users to interact with remote systems.

Telnet

Telnet is practically as old as the Internet itself. It was launched alongside the Net in 1969 and is used by purists to this day.

Telnet is an application protocol that helps users communicate with a remote system. It uses a text-based interface to create a virtual terminal, allowing administrators to access applications on other devices.

SSH

SSH serves the same primary function as Telnet but does so in a more secure way. This protocol provides secure access even on unsecured networks, eliminating many of Telnet's vulnerabilities.

With SSH, administrators can log into remote devices, execute commands, move files between devices, and more.

Note: Lear more in-depth about SSH in our article How Does SSH Work?

Telnet vs. SSH: Comparison Overview

Although Telnet and SSH have some similarities, there are many differences between the two. The most important is that SSH is much more secure than Telnet, which has caused it to replace Telnet almost completely in everyday use.

Telnet and SSH use different default ports. While Telnet can only transfer data as plain text, SSH can encrypt traffic in both directions.

FeatureTelnetSSH
OperationUses TCP port 23 and works best with local area networks.Uses TCP port 22 by default. Easy to change the port number.
SecurityLess secure than SSH, with many vulnerabilities. Difficult to encrypt data.Highly secure.
AuthenticationNo authentication mechanism.Uses public key encryption.
Data FormatsData is transferred as plain text.Data is transferred in an encrypted format via a secure channel.
Operating SystemsLinux and Windows.All popular operating systems.
Bandwidth UsageLow.High.

Operation

Telnet

Telnet requires a server application on the remote system you want to manage, and the client application installed on the local machine.

Telnet uses the TCP protocol and port 23 to establish a connection with a remote system. This system then acts as a Telnet server and can receive commands. Commands are sent using the NVT (Network Virtual Terminal) format, received and interpreted by the server, and sent to the appropriate application.

Telnet in operation

SSH

SSH starts by establishing a secure connection to the server through port 22 (although you can change the port number). With key-based authentication, after the client verifies the server, a session key is generated and sent to both client and the server. This key encrypts the traffic for the ongoing session.

Finally, the server verifies the client using an SSH key pair generated. Once the client is authenticated, an encrypted connection is established, and the two systems securely exchange data.

Note: If you are working with Windows, you need an SSH client, such as Putty, to use SSH.

Security

Telnet

Telnet doesn't use any security mechanisms or protocols when sending data. This makes it highly vulnerable unless it is used on private, trusted networks.

SSH

When SSD sessions use key-pairs for authentication, it is extremely difficult to decrypt and read the exchanged data. This makes SSH a highly secure way of transferring data over unsecured networks.

Authentication

Telnet

Telnet doesn't use any authentication mechanisms when establishing a connection.

SSH

The most common and secure SSH authentication is public key authentication. When an SSH key pair is generated, the client holds the private key, while the public key is sent to a server. If a client tries to access a server using SSH, the server authenticates the client by comparing the public key to the private key. If the keys match, the two systems can establish a secure connection.

Note: Learn how to generate SSH keys by visiting one of our tutorials depending on the OS you are using:

Data Formats

Telnet

Telnet transfers data as plain text using the NVT format.

SSH

SSH uses an encrypted format to transfer data through a secure connection.

When to Use Telnet?

Since SSH is vastly more secure than Telnet, there are two cases when it is recommended to use Telnet over SSH:

  • When working on trusted networks (such as LANs) that are not connected to the Internet.
  • When working with devices that don't support SSH.

Telnet's lack of security stops being an issue in these cases, while lower bandwidth usage becomes a benefit.

When to Use SSH?

Due to its highly secure nature, you should use SSH whenever you want to connect to a remote system over the Internet.

SSH also offers more functionality than Telnet, such as secure file transfer and port forwarding.

Conclusion

After reading this tutorial, you should better understand the differences between Telnet and SSH, and the best way to use them.

Was this article helpful?
YesNo
Aleksandar Kovačević
With a background in both design and writing, Aleksandar Kovacevic aims to bring a fresh perspective to writing for IT, making complicated concepts easy to understand and approach.
Next you should read
How Does SSH Work?
December 17, 2020

SSH is a network protocol designed to provide a more secure network communication by employing encryption. This article deals with the mechanism behind SSH and its layers, and lists some of its common use cases.
Read more
How to Use SSH Port Forwarding
May 18, 2020

This article demonstrates 3 distinct methods used to port forward SSH connections. It examines the syntax of the individual commands and teaches you everything you need to know to implement SSH port forwarding successfully.
Read more
How to Generate SSH Key in Windows 10
May 5, 2020

This article explains two methods of generating SSH keys on a Windows 10 system. One method uses the PuTTY tool, while the other uses the OpenSSH client utility.
Read more
How To Use Telnet On Windows
March 24, 2021

The Telnet client is not the best cybersecurity practice, however it is very useful for port troubleshooting. Learn how to turn on the Telnet client feature and check for open ports on Windows.
Read more