Port reference › Remote access
Port 23 · Telnet
Legacy unencrypted remote shell
TCP Remote access Exposure risk: High
What is port 23 used for?
An old plaintext remote login protocol. Still seen on old network gear, and handy for testing whether a port is open (telnet host 80).
Well-known port (0-1023): opening it on Linux needs root (or CAP_NET_BIND_SERVICE).
Security notes
Usernames and passwords travel in clear text. Use SSH for device management and disable Telnet. It was the main entry point for IoT botnets like Mirai.
Allow port 23 through the firewall
This port is risky to expose, so the commands below allow only the IPs you specify.
# Replace 203.0.113.10/32 with the IP or network you want to allow
sudo ufw allow from 203.0.113.10/32 to any port 23 proto tcp
sudo ufw status # Replace 203.0.113.10/32 with the IP or network you want to allow
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10/32" port port="23" protocol="tcp" accept'
sudo firewall-cmd --reload # Replace 203.0.113.10/32 with the IP or network you want to allow
sudo iptables -A INPUT -p tcp -s 203.0.113.10/32 --dport 23 -j ACCEPT # Replace 203.0.113.10/32 with the IP or network you want to allow
New-NetFirewallRule -DisplayName "Allow TCP 23" -Direction Inbound -Protocol TCP -LocalPort 23 -RemoteAddress 203.0.113.10/32 -Action Allow # Replace sg-0123456789abcdef0 with your security group ID
aws ec2 authorize-security-group-ingress --group-id sg-0123456789abcdef0 --protocol tcp --port 23 --cidr 203.0.113.10/32 Check whether port 23 is open
sudo ss -tlpn | grep ':23 ' netstat -ano | findstr :23 nc -zv SERVER 23
# Windows
Test-NetConnection SERVER -Port 23 sudo lsof -i :23 Ports used together
- 22 SSH · Linux remote shell, SFTP, Git