I'm working on a local dev setup that requires the use of telnet (playing with setting up a MUD server) so please no feedback suggesting I use SSH as a more secure alternative.
However, though I've got the telnet daemon up, I am getting this output when I telnet localhost.
$ telnet localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.What are some reasons that the connection is closed? I have checked the docs on hosts.allow and hosts.deny, and have decided to not put any entries in either as the default is to allow all and that is sufficient for my local dev purposes.
83 Answers
Okay, let's investigate this, step by step. To figure out what is actually running on telnet's port, type:
sudo netstat -tulpn | grep :23and paste the output.
From another angle: what PHP game library are you using?
3Note: I just went around looking for MUD server with NAGS game library and found this: nags-php-mud. My answer is irrelevant if you are using something else.
The config.php had the following config:
<? /*Modify the setting here to set up your game server */ $configarray = array( 'DB_HOST' => 'localhost', 'DB_USERNAME' => 'nags', 'DB_PASSWORD' => 'password', 'DB_DATABASE' => 'nags', 'IP_ADDRESS' => '0.0.0.0', 'SERVER_PORT' => '4000', 'SERVER_NAME' => 'NAGS GAMING SYSTEM',
);?>So the port number is 4000. Can you try updating the IP Address to 127.0.0.1 then connecting to port 4000 using telnet: telnet 127.0.0.1 4000
Updated
In the above command, you have telnet localhost and not telnet localhost 4000.
I tried running it but I am getting some issue. It displays the following and I am unable to trace it:
PHP Notice: Undefined index: quiet in /home/blvdeer/Downloads/nags-php-mud-master/nags.php on line 34
PHP Notice: Undefined index: q in /home/blvdeer/Downloads/nags-php-mud-master/nags.php on line 34
PHP Notice: Undefined index: deamon in /home/blvdeer/Downloads/nags-php-mud-master/nags.php on line 38
PHP Notice: Undefined index: d in /home/blvdeer/Downloads/nags-php-mud-master/nags.php on line 38
PHP Notice: Undefined property: MAIN::$MESSAGE in /home/blvdeer/Downloads/nags-php-mud-master/modules/main.php on line 158
SYSTEM: (LOAD MODULE) MESSAGE
SYSTEM: (LOAD MODULE) CONFIGURE
SYSTEM: (LOAD MODULE) DATABASE 3 Try with telnet localhost 80Where 80 is the port on which your server is running.
I tried with 80 port for apache server and it works.
Also you might need to use -K and -X option. Read more about them in the man telnet
3