DEV Community

Vincent Tommi
Vincent Tommi

Posted on

Introduction to the Internet: Understanding Telnet for Beginners

Introduction

The internet allows computers around the world to communicate and share resources. One important concept in computer networking is remote access, which allows a user to connect to and interact with a computer located somewhere else.

One of the older tools developed for remote access is Telnet.

In this article, we will explore what Telnet is, how it works, the commands used to connect to remote computers, and why modern systems generally prefer SSH.

What Is Telnet?

Telnet is a network protocol that allows a user to connect to a remote computer and execute commands through a text-based interface.

A remote computer, also called a remote host, is a computer that you access over a network rather than directly using its keyboard and screen.

With Telnet, a user can interact with the remote system as though they were logged in locally, provided they have the necessary access permissions.

Example

Imagine you are in Nairobi and need to access a computer located in another city. Instead of physically travelling to that computer, you could use a remote-access tool to connect over a network.

Telnet was designed to provide this kind of remote terminal access.

Requirements for Using Telnet

To connect to a remote computer using Telnet, you generally need:

  1. Hostname or IP address: Identifies the remote computer.
  2. Valid user account: The remote system must authorize your access.
  3. Network connectivity: Your computer must be able to reach the remote host.
  4. Telnet service: The remote computer must have a Telnet service running and accessible.

Traditional Telnet access is not anonymous by default; you normally need valid credentials and permission to use the remote system.

Common Telnet Commands

Telnet commands specify the remote computer to which you want to connect.

1. Connecting Using a Hostname

The basic syntax is:

telnet hostname
Enter fullscreen mode Exit fullscreen mode

For example:

telnet math.sunysb.edu
Enter fullscreen mode Exit fullscreen mode

This attempts to establish a Telnet connection to the host named math.sunysb.edu.

The connection will only succeed if the hostname resolves, the network permits the connection, and a Telnet service is available.

2. Connecting Using an IP Address

You can also specify the remote computer's IP address:

telnet 192.0.2.10
Enter fullscreen mode Exit fullscreen mode

Here, 192.0.2.10 is an example address reserved for documentation. It is not intended to identify a real public server.

The command attempts to connect to the computer at that address.

3. Connecting to a Specific Port

Telnet can also specify a port number:

telnet hostname port
Enter fullscreen mode Exit fullscreen mode

For example:

telnet example.com 80
Enter fullscreen mode Exit fullscreen mode

This attempts to open a TCP connection to port 80, commonly associated with HTTP.

Note that connecting to a port does not automatically mean you are logging into a computer. Telnet can also be used to test whether a TCP service is reachable, although modern diagnostic tools are often more suitable.

How Does Telnet Work?

The basic process can be summarized in four steps:

  1. The user enters a hostname or IP address.
  2. The computer attempts to establish a network connection with the remote host.
  3. If the service is available, the remote system may request authentication.
  4. Once authorized, the user can interact with the remote terminal.

The connection depends on network availability, service configuration, and access permissions.

Is Telnet Secure?

An important limitation of traditional Telnet is that it does not encrypt the communication by default.

This means that usernames, passwords, and other transmitted information may be exposed to someone monitoring the network.

For this reason, Telnet is generally unsuitable for logging into remote computers over untrusted networks.

Telnet vs. SSH

Feature Telnet SSH
Main purpose Remote terminal access Secure remote access
Encryption No encryption by default Encrypts communication
Credentials Can be exposed in transit Protected by encryption
Modern use Legacy systems and limited diagnostics Standard choice for remote administration

SSH (Secure Shell) is generally preferred for remote administration because it provides encrypted communication and supports secure authentication.

When Is Telnet Still Useful?

Although Telnet is largely outdated for secure remote login, it can still be encountered in:

  • Legacy networking environments.
  • Networking education and demonstrations.
  • Testing whether a TCP port is reachable.
  • Older systems that still depend on the protocol.

Only connect to systems you own or are explicitly authorized to access.

Conclusion

Telnet is an older Internet protocol that allows users to connect to remote computers and interact with their command-line interfaces. To use it, you typically specify a hostname or IP address and need permission to access the remote system.

The most important limitation to remember is that traditional Telnet does not encrypt its traffic. For secure remote access, SSH is the preferred modern alternative.

Quick Revision Notes

  • Telnet: A protocol for accessing a remote computer through a text-based terminal.
  • Remote host: A computer accessed over a network.
  • Hostname: The name used to identify a computer on a network.
  • IP address: A numerical network address identifying a device or interface.
  • Basic command: telnet hostname
  • Main disadvantage: Communication is unencrypted by default.
  • Modern alternative: SSH.

Remember: Telnet provides remote terminal access, while SSH provides remote terminal access with encryption.

Top comments (0)