How to Check if a TCP port is open using telnet


How to Check if a TCP port is open using telnet

You are here:



This guide details how to check if a remote port is open using telnet.

What is telnet?

Telnet is a now-outdated protocol first developed in 1969 and often used to control computers from a remote location over a command line interface. Telnet has been superseded by ssh for this purpose due to its lack of security and authentication by default. However, as telnet has been ported to most operating systems and connects using TCP it is a useful tool for troubleshooting.

Installing telnet

On Debian:

sudo apt install telnet

On Centos or AlmaLinux

yum install telnet


Testing a remote port

Telnet can be used to check if a remote port is open which is great for testing firewall rules are working as expected or if services are running.  To test a host with IP on port 80 run

telnet 80

If the port is open then you should see something like:

[root@host~]# telnet 80
Connected to
Escape character is '^]'.

If the port specified is not open then you would expect to see telnet state that it is trying to connect but then hanging or explicitly stating that the connection has been refused.


[root@host~]# telnet 80


[root@host~]# telnet  80
telnet: connect to address Connection refused
Table of Contents