The telnet service is not running
The telnet service not running is one of the most likely causes of the “connection refused” error.
Telnetd is the server program that allows Telnet connections. So for Telnet to work properly, the telnet service needs to be installed on the machine you are trying to connect to.
If Telnetd is not installed, there is no server program to respond to the Telnet connection request from your computer. This results in the “connection refused” error.
Error :
telnet localhost 1181
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
How to Fix This Error :
Check if Telnet is actually installed on the machine they want to connect to. If Telnetd is not installed, we need to install the Telnet server program.
Command :
apt-get install telnetd
Output :
Next, we needed to restart the Telnet server program to do that follow the Below Command.
Command :
/etc/initd/inetd restart
Output :
How To Solve Telnet Connection Refused By Remote Host In Linux
Wanted to access a remote server over Telnet but got “connection refused” errors? This is a common problem that can leave you stranded when trying to handle Linux systems from afar. Failure to initiate a Telnet session locks you out of administrating and diagnosing problems on servers, networking equipment and other devices.
The good news is that often these “connection refused” errors are easy to resolve with just some basic checks. In this simple, step-by-step guide, we will get to know how to quickly get Telnet working again. By tweaking firewall rules, fixing network/port settings, and checking for connectivity issues one can have Telnet sessions up in no time. The above couple of small changes will take care of the irritating connection-related difficulties and allow remote reentry into your Linux-based gadgets in an effortless way.