Telnet [Unable to connect to remote host: Connection refused] Telnet [Unable to connect to remote host: Connection refused] linux linux

Telnet [Unable to connect to remote host: Connection refused]


0.Configure Guest OS via Virtualbox as follows.

VirtualBox Manager > Settings > Network Attached to: Bridged AdapterName : eth0Advanced:Promiscuous Mode: Allow All

1.Install telnet use this command in main OS terminal:

sudo apt-get install xinetd telnetd 

2.Edit /etc/inetd.conf in main OS using your favourite file editor with root permission,add this line:

telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd

3.Edit /etc/xinetd.conf in main OS,make its content look like following:

Simple configuration file for xinetd## Some defaults, and include /etc/xinetd.d/defaults{# Please note that you need a log_type line to be able to use log_on_success# and log_on_failure. The default is the following :# log_type = SYSLOG daemon infoinstances = 60log_type = SYSLOG authprivlog_on_success = HOST PIDlog_on_failure = HOSTcps = 25 30}

4.Use this command to start telnet server in main OS:

sudo /etc/init.d/xinetd restart 

That was all. By the way, this configuration will affect just main OS which you use instead of Guest OS. That is, you can create a telnet connection just from Guest OS's terminal to main OS, not from main OS to Guest OS. Because, telnet server is in main OS. To be able to do two way telnet communication, you should repeat the steps above in Guest OS's terminal.

Resource : http://ubuntuguide.net/install-and-enable-telnet-server-in-ubuntu-linux


  1. Check iptable rules.

iptables -L

  1. Flush iptables

iptables -F

  1. Try telnet again

Attention: if you flush iptables (when run: iptables -F) it can just close your ssh connection, so you will not be able to connect to your server again


first we need to see ubuntu system log with this command

sudo gedit /var/log/syslog

and if you will see this error "execv( /usr/sbin/tcpd ) failed: No such file or directory" then run this command

sudo apt-get install tcpd

it will solve your problem (if not then you need to search your system error on google)