Telnet is an application used to connect to a remote host's command line terminal interface. It was traditionally utilized by network and system administrators for administering network devices. However, telnet has become obsolete for remote administration purposes. Nevertheless, it is still commonly employed to verify connectivity to remote services based on TCP. In a client-server architecture, telnet can be utilized to ensure that there are no firewalls blocking incoming connections to the server.
Telnet command syntax:
telnet host port
For example, if we want to test connectivity to a remote service using port 9000 on any host, we would need to type the following command: "telnet <<IP/hostname>> 9000."
If the service is running without any firewalls blocking incoming connections, the telnet command will display the following prompt:
The below is what happens when a firewall in between is rejecting connections:

In this scenario, when the telnet application returns the message "Connection refused," it signifies that there is a firewall blocking connections to the specified TCP port on the remote host. This failure of telnet can be due to any of the following reasons:
- Incoming connections are being dropped by a network or host firewall.
- The remote host is currently inaccessible or offline.
- Network connectivity issues are preventing communication between the client and server.
- The service on the client is not running on the designated port.
To address this situation, further troubleshooting steps are necessary. These may include performing a traceroute from the client side to identify where the connection is being interrupted or contacting the administrator of the remote host to verify if the remote service is running and permitted by any intermediate firewalls.