Skip to content

July 23, 2017

Check if a Service is Running Using Telnet and How to Quit Telnet Session

by linux

Telnet is not used that much anymore. To connect to a managed switch CLI this could be your only options. But then telnet has other use: you can check if a service run on a port on a remote machine.

For example to check if mysql server is running on a remote machine:

 # telnet 3306
Connected to
Escape character is '^]'.

To check if ssh is running on a remote machine:

 # telnet 22
Connected to
Escape character is '^]'.
Protocol mismatch.
Connection closed by foreign host.

You should get some reply from the remote machine with a text.

If you get no reply that means either that the service is not running or the service is running on other port (in case of SSH) or that the remote machine’s firewall blocks the access from outside to that service.

Now, if you want to quit telnet you will notice Ctrl + C is not working.

In order to quit telnet press Ctrl + ] to get to telnet console then type: quit

Read more from Linux Quick Tips

Leave a Reply


Note: HTML is allowed. Your email address will never be published.

Subscribe to comments