Testing remote TCP ports using telnet

On occasion, while troubleshooting an issue you might need to see if a TCP port is open on a remote server.This is quite simple to do in most cases using telnet for Windows, Linux or macOS command line.

Example:

telnet 12.34.56.78 22

This will check to see if port 22 is open on IP address 12.34.56.78

An example successful connection is as follows:

telnet 12.34.56.78 22

Trying 12.34.56.78...

Connected to 12.34.56.78.

Escape character is '^]'.

SSH-2.0-OpenSSH_7.4

 

This shows that you have made a successful connection to the server, if it was to fail or timeout it would look like this and get no further:

telnet 12.34.56.78 22

Trying 12.34.56.78...