Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Check if network port is open

On the local system, check if something is listening to the port:

netstat -tlpn

On a remote system, you can use telnet or ncat to check to see if you can actually get to the port:

echo '' | telnet myserver 1054

If successful, telnet returns 'Connected to myserver' before closing out.

echo '' | nc -v myserver 1054


$ echo '' | nc -v myserver 1054
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to 192.168.50.35:1054.
$ echo '' | nc -v myserver 1055
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: No route to host.

Comments