Port 23 (Telnet)

Port 23 is the port of Telnet, a long-standing protocol for logging in to the command line of a remote computer, over TCP.

Key facts

Port
23
Protocols
TCP
Range
System port (Well-Known), 0-1023
IANA service name
telnet

IANA assigns ports in this range to well-known services, under RFC 6335.

About port 23

Port 23 is the port of Telnet, a long-standing protocol for logging in to the command line of a remote computer, over TCP. With Telnet, all traffic, including the username and password, travels unencrypted, which is why servers today are accessed over SSH, on port 22.

The protocol is defined in RFC 854, and IANA registers port 23 for the telnet service.

What port 23 is used for

Telnet servers are hardly used today, but the protocol and its client still show up in a few places:

  • Older network equipment: routers, switches, and legacy systems that can only be managed over Telnet, usually on an internal management network.
  • Port checks: the telnet client is a quick way to check whether a TCP port is open on a server, for example by connecting to port 25 of a mail server to see its greeting line.
  • Training and lab environments: closed networks used to demonstrate how text-based protocols work.

Port 23 in the firewall

Servers don't need a Telnet service, so port 23 should stay closed, and we recommend not installing a Telnet server at all. With a firewall that blocks incoming connections by default, no extra rule is needed to block the port.

When older equipment can only be managed over Telnet, allow access to it only from the internal management network, for example:

  • UFW: ufw allow from 10.0.0.0/24 to any port 23 proto tcp
  • firewalld: firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/24" port port="23" protocol="tcp" accept'

Risks and security

With Telnet, the password and commands cross the network as plain text, and anyone along the way can read them. The standard alternative is SSH, which gives you the same command-line login over an encrypted connection.

  • On servers, disable the Telnet server and remove it if it's installed.
  • On network equipment, enable SSH login when the device supports it, and then turn off Telnet.
  • When you have no choice but to use Telnet, limit access to an internal management network or a VPN connection.
  • Change the default passwords of your network equipment.

Commands to check and configure

  • ss -tlnp | grep ':23 '

    Checks whether any service is listening on port 23 on the server. No output means no service is listening on the port.

  • nc -zv server.example.com 23

    Checks from your computer whether port 23 on the server is open and reachable.

  • telnet mail.example.com 25

    Uses the telnet client to check that a TCP port is open, and shows the service's greeting line (a mail server in this example).

  • ssh user@server.example.com

    Logs in to the server's command line over an encrypted connection, the secure alternative to Telnet.

  • ufw deny 23/tcp

    Explicitly blocks incoming connections to port 23 (UFW).

  • firewall-cmd --permanent --remove-service=telnet

    Removes the Telnet service from the active zone in firewalld, if it was added before. Then run firewall-cmd --reload.

Port 23 in the IANA registry

Port Protocol Service IANA registry description
23 TCP telnet Telnet
23 UDP telnet Telnet

Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)

Port 23 FAQ

What's the difference between Telnet and SSH?

Both protocols let you log in to the command line of a remote computer. With Telnet, everything travels unencrypted, while SSH encrypts the whole connection, including login details, and also supports logging in with a key instead of a password. That's why SSH, on port 22, is the standard way to manage servers.

Can I use the telnet command to check whether a port is open?

Yes. The command telnet server.example.com 443 tries to connect to the given port, and a successful connection shows the port is open and reachable. You can also check this with nc -zv, and on Windows, where the Telnet client isn't installed by default, with the Test-NetConnection command in PowerShell.

How do I move from Telnet to SSH on network equipment?

In the device settings, enable the SSH server, create a user with a strong password or a key, and test an SSH login in a separate window. Only after the SSH login works, turn off Telnet in the device settings.

Is Telnet still in use?

As a remote login server, Telnet is found today mainly on older equipment and internal networks. The telnet client, on the other hand, is still useful as a simple tool for testing a connection to a port and talking manually to text-based services, such as mail servers.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement