# telnet - Connection closed by foreign host

## sumanjay

After following all the directions on the forum -

1) emerging telnet

2) Configuring xinetd to startup

3) Adding telnetd to xinetd

....I still can't telnet into my local system. I'm trying to get a MUD running for a project and am unable to telnet into it. I can't telnet into the local telnet port either. 

Error messages when telnetting -

bash-2.05b# telnet cicero

Trying 127.0.0.1...

Connected to Cicero.

Escape character is '^]'.

Connection closed by foreign host.

Relevant output (I hope!) from /var/log/messages -

Apr 15 13:59:09 Cicero xinetd[12067]: bind failed (Address already in use (errno = 9 :Cool: ). service = telnet

Apr 15 14:02:33 Cicero xinetd[12150]: FAIL: telnet address from=127.0.0.1

Apr 15 14:02:33 Cicero xinetd[12067]: START: telnet pid=12150 from=127.0.0.1

Apr 15 14:02:45 Cicero xinetd[12158]: FAIL: telnet address from=127.0.0.1

Apr 15 14:02:45 Cicero xinetd[12067]: START: telnet pid=12158 from=127.0.0.1

Apr 15 14:07:26 Cicero xinetd[12067]: Exiting...

----------

## Ravse

Try to stop your telnetd before you load the MUD program. I don't believe you need a telnet server for something like that, but I'm not sure.

Which port is your MUD program listening to? The default TCP/23 telnet port?

----------

## sumanjay

The MUD is running on port 4000. Anyway, even after stopping telnetd, I still can't telnet to the MUD on its port. I used to be able to run the MUD and telnet into it flawlessly on Slackware. With no difficulties at all. I can't understand why it is so  difficult to do something as simple as telnet into my own machine.

----------

## sumanjay

Well, I guess if Gentoo is going to make be sweat just to be able to telnet into my local machine, I really am not cut out to be a Gentoo user. Good luck to all you guys. I'm heading back to Slack. I NEED to get cracking on my project and I can't afford to spend any more time on fixing strange unexplained behaviour.

----------

## Ravse

Hi sumanjay,

If you ever feel like trying Gentoo again, here is how I got my telnetd to work. It took me 10 mins. with the help of these forums.

```
# emerge netkit-telnetd

# vim /etc/xinetd.d/telnetd
```

Set "disable = no"

```
# vim /etc/xinetd.conf
```

Comment out "only_from = localhost"

```
# /etc/init.d/xinetd start
```

And if you like the service to start at system startup

```
# rc-update add xinetd default
```

As for your MUD program have you checked that the program actually runs with ps or netstat?

Good luck!

----------

