Reference · Network exposure
Telnet port 23: check whether anything listens, and turn it off
Check whether a Telnet server listens on port 23: ss on Linux, Get-NetTCPConnection on Windows and an nc test from another network; then remove inetutils-telnetd, turn Telnet off on routers and switches and delete port forwards.
| Target artifact | A Telnet server on TCP port 23: on Ubuntu, /usr/sbin/telnetd from the inetutils-telnetd package, started by an inetd superserver; on routers, switches, cameras and recorders, the Telnet service in the firmware. |
|---|---|
| Default behaviour | On Ubuntu 24.04, installing the server package leaves its line in /etc/inetd.conf switched off, so port 23 stays closed until someone enables it. Other equipment varies by maker and model. Telnet is a clear-text protocol: sign-in names and passwords cross the network unencrypted. |
| Safe state | Nothing listens on port 23: the checks print nothing, no Telnet server package is installed, equipment is managed over SSH with Telnet off, and a test from another network does not connect. |
| Check on Linux | sudo ss -tlnp | grep ':23 ' |
| Check on Windows | Get-NetTCPConnection -State Listen -LocalPort 23 -ErrorAction SilentlyContinue | Select-Object LocalAddress, LocalPort, OwningProcess |
| Check from another device | nc -vz -w 5 PUBLIC_IP 23 from a network outside yours |
| Fix on Linux | sudo apt purge telnetd inetutils-telnetd |
| Fix on network equipment | turn Telnet off and keep SSH; on Cisco IOS, transport input ssh on the vty lines |
| Fix at the router | delete any port forward to port 23 |
Read the result
Both checks read the computer they run on: no output means nothing on it listens on port 23. On Ubuntu 24.04 with the Telnet server enabled, ss printed:
LISTEN 0 10 0.0.0.0:23 0.0.0.0:* users:(("inetutils-inetd",pid=2713,fd=4))The process is the superserver inetutils-inetd: it holds the port on every IPv4 address (0.0.0.0) and starts /usr/sbin/telnetd when a connection arrives. On Windows, a row means a program listens on port 23; OwningProcess is the ID of its process. A router, camera or recorder does not show in these checks: test it from another device.
What listens on port 23, and why scanners try it
The Internet Assigned Numbers Authority (IANA) registers port 23 to the service name telnet, with RFC 854 as the reference. Telnet is a remote terminal protocol: RFC 854, of May 1983, gives its goal as "a standard method of interfacing terminal devices and terminal-oriented processes to each other". Cisco's hardening guide for its IOS devices counts it among "clear-text protocols" and says to use SSH instead, "so authentication data and management information are encrypted".
Alert TA16-288A of the US Cybersecurity and Infrastructure Security Agency (CISA), released on 14 October 2016 and now archived, describes the Mirai malware, which "uses a short list of 62 common default usernames and passwords to scan for vulnerable devices". The devices affected were mostly home routers, network cameras and digital video recorders, and CISA's preventive steps include monitoring ports 23/TCP and 2323/TCP. The scanner feed's port table shows how many blocked sources tried port 23 on this site's own server in the last 7 days.
The server software has had serious flaws in 2026. CVE-2026-24061, published on 21 January 2026, is an authentication bypass in the telnetd of GNU Inetutils through version 2.7: Ubuntu's notice USN-7992-1 of 2 February 2026 says a remote attacker "could use this issue to bypass authentication and open a session as an administrator". CISA added the flaw to its Known Exploited Vulnerabilities catalog on 26 January 2026. Notice USN-8387-1 of 4 June 2026 fixed two more flaws in the same server; one, CVE-2026-32746, could allow denial of service or arbitrary code execution.
On Ubuntu 24.04 LTS, inetutils-telnetd 2:2.5-3ubuntu4.1 fixes the first flaw and 2:2.5-3ubuntu4.2 the other two. On 22.04 LTS the June fixes come through Ubuntu Pro only, as do all three on 20.04 and 18.04. Ubuntu's security team notes: "telnetd is insecure by design and it is highly recommended to not use it."
Ubuntu: what the packages do
Tested on 13 November 2026 in an Ubuntu 24.04.5 container, where systemd does not run, with inetutils-telnetd 2:2.5-3ubuntu4.2 from the universe repository:
inetutils-telnetdholds the server;telnetdis a transitional package that depends on it. Neither has a systemd service or socket: installingtelnetdalso installed the superserverinetutils-inetd.- Installing does not open port 23: the post-install script adds the Telnet line to
/etc/inetd.confwith the mark#<off>#in front.sudo update-inetd --enable telnetremoves the mark; with the superserver started, port 23 then listened. telnetd-sslholds the older netkit server and also depends on a superserver. apt removes the other two packages to install it, so it was not installed for this test.
List the packages, the state of the line and the installed version:
dpkg -l | grep -E 'telnetd|inetd'
grep -n telnet /etc/inetd.conf
apt-cache policy inetutils-telnetdA telnet line with no # in front is active.
Turn it off and remove it
- Switch the line off. In the test, port 23 closed at once while the superserver kept running:
sudo update-inetd --disable telnet- Remove the packages. apt lists what it will remove and asks first: read the list. If the package list showed
telnetd-ssl, purge that name instead. In a simulated run, with apt's-soption, the command also removed the superserver and the helper packages that came with it.
sudo apt purge --autoremove telnetd inetutils-telnetd- Run the check again: it should print nothing.
For a remote terminal, use SSH: see Guide 5 and SSH password sign-in.
Windows
Microsoft says the Telnet Client "isn't installed in most client or server versions" of Windows by default; a client connects out to other machines and does not show in the check. Microsoft deprecated its Telnet server in Windows Server 2012 R2: "Telnet server is deprecated. Instead, use Remote Desktop." For that service, see Remote Desktop port 3389.
Routers, switches and other equipment
Before Telnet goes off on a device managed over the network, confirm in a second session that SSH sign-in works.
Cisco IOS
Cisco's guide "Harden IOS Devices" (document 13608, updated 12 September 2024) says to use transport input ssh "instead of clear-text protocols, such as Telnet and rlogin" on the virtual terminal (vty) lines. Its example:
line vty 0 4
transport input sshMikroTik RouterOS
MikroTik's guide to securing a router says to "Keep only secure ones" of the services under /ip service; its example turns off telnet, ftp, www, api and api-ssl in one line. For Telnet alone:
/ip service disable telnet
/ip service printThe guide does not say whether Telnet is on by default.
Home routers, cameras and recorders
- For a home router, see Home router check for remote management, UPnP and port forwards, and delete any port forward to port 23.
- Where a device's Telnet cannot be turned off, the preventive steps in CISA's alert still apply: change every default password to a strong one, install security updates as soon as they are available, and disable Universal Plug and Play (UPnP) on the router "unless absolutely necessary".
- CISA's steps for a device infected with Mirai: disconnect it, reboot it while disconnected, and change its password before it goes back on the network, or it "could be quickly reinfected".
Test from outside
Run the test from a network outside yours, such as a phone's hotspot, against your public address:
nc -vz -w 5 PUBLIC_IP 23Test-NetConnection -ComputerName PUBLIC_IP -Port 23nc prints | Meaning |
|---|---|
Connection to PUBLIC_IP 23 port [tcp/telnet] succeeded! | Port 23 accepts connections from that network |
failed: Connection refused | Nothing accepts the connection on port 23 |
timed out: Operation now in progress | No answer within the 5 seconds of -w 5: the request was dropped on the way, as a firewall does |
Wording from nc (netcat-openbsd 1.226) on Ubuntu 24.04, tested on 13 November 2026. In PowerShell, TcpTestSucceeded : True means the port accepted the connection. CISA's alert also names port 2323: repeat the checks with that number. Open-port self-audit covers what listens on each computer, and IPv6.
UFW on Ubuntu
UFW's manual says that on installation it "is disabled with a default incoming policy of deny": while sudo ufw status verbose prints Status: inactive, it filters nothing. Once it is enabled with that policy, port 23 is closed to other machines unless a rule allows it. Remove such a rule with sudo ufw delete allow 23/tcp; if that prints Could not delete non-existent rule, find the rule with sudo ufw status numbered and remove it with sudo ufw delete NUMBER.
Related guides and lookups
Sources
- IANA: Service Name and Transport Protocol Port Number Registry
- RFC 854: Telnet Protocol Specification, May 1983
- CISA: alert TA16-288A, Mirai and other botnets, 14 October 2016
- CISA: Known Exploited Vulnerabilities catalog, version 2026.11.13
- Ubuntu Security: CVE-2026-24061
- Ubuntu: USN-7992-1, Inetutils vulnerability, 2 February 2026
- Ubuntu: USN-8387-1, Inetutils vulnerabilities, 4 June 2026
- Ubuntu manual: ufw, 24.04
- Cisco: Harden IOS Devices, document 13608
- MikroTik: Securing your router
- Microsoft Learn: Get-NetTCPConnection
- Microsoft Learn: Test-NetConnection
- Microsoft Learn: use Telnet to test SMTP communication
- Microsoft Learn: features removed or deprecated in Windows Server 2012 R2