Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to telnet from host (centos) to host (ubuntu). When I try to connect to the Ubuntu host, I get:

telnet 4949
Connected to a.b.c (
Escape character is '^]'.
Connection closed by foreign host.

on host (Ubuntu)

ps -ef | grep telnet
root      6682  4564  0 00:33 pts/0    00:00:00 grep --color=auto telnet

but telnetd is already at the newest version.

apt-get install telnetd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
telnetd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 348 not upgraded.

How can I telnet to the Ubuntu machine?

share|improve this question
I assume there is a reason why you are not using the more secure and more convenient "secure shell" (ssh)? – Soviero Oct 22 '11 at 5:47
Did the inetd get restarted after the telnetd install? – Zoredache Oct 22 '11 at 7:57
The OP didn't appear to state his issue correctly. BillThor noted that the kamal is trying to connect to a munin node. – Rilindo Oct 23 '11 at 0:34

Remove the telnetd package it is not needed. Execute the command apt-get purge telnetd to fully remove the package.

You only need the teluet client package to connect to other servers.

It appears you are testing a Munin node. Your allow rules do not allow access from the host you are connecting from. Edit your /etc/munin/munin-node.conf file to allow access.

share|improve this answer

It looks to me that there is a firewall involved somewhere along the way. Maybe even the unbutu client machine has it enabled probably for telnet.

Another thought is that the /etc/xinetd.d/telnet entry is disabling telnet on the ubuntu machine. You could check this out, and then kill -1 the xinetd process after making the change.

BUT....Why not use ssh to get to the other machine? It is FAR more secure than telnet and does nearly the same thing. All you'd have to enter is:

share|improve this answer
i cannot use ssh, since i wan to telnet to a port other than 22 to see if the application is working – kamal Oct 22 '11 at 11:24
@kamal Use the swiss army knife (netcat) for that. Usage: nc host port) – Lekensteyn Oct 22 '11 at 13:42
@kamal If you're trying to connect to a non-telnet application, why did you install telnetd? – Shane Madden Oct 22 '11 at 18:59

Your telnet is working fine. What you are trying to do is to test munin connectivity. The steps are documented here:

But to make it short, after you get to this:

# telnet 4949
Connected to
Escape character is '^]'.

you need to enter a command that will query the plugin, such as df:

fetch df

Which should return the following:

_dev_hda1.value 83

Please review the above URL.

share|improve this answer

When I'm testing networking connectivity, I always try to connect from localhost to see if there aren't firewalls/routers/etc involved in causing problems.

From the ubuntu machine, are you able to do:

telnet localhost 4949
share|improve this answer
localhost telnet works: root@mpcore:/etc# telnet localhost 4949 Trying ::1... Trying Connected to localhost. Escape character is '^]'. # munin node at mpcore help # Unknown command. Try cap, list, nodes, config, fetch, version or quit list apache_accesses apache_processes apache_volume cpu df df_inode entropy forks fw_packets http_loadtime if_err_eth0 if_eth0 interrupts iostat iostat_ios irqstats load lpstat memory open_files open_inodes proc_pri processes swap threads uptime users vmstat – kamal Oct 22 '11 at 11:17
If you can telnet to localhost, then telnet is working fine. The next step is to try to telnet from another host on the same subnet (something with a 10.0.11.x IP). – David Oct 22 '11 at 16:59
@Dave this is only partly a good solution. This test only works for software that is listening on all IP addresses. If the software would only listen on the localhost then you would succeed as well but you can still not connect from outside. Better would be to test the IP address from the ethernet interface. (e.g. telnet 4949) – Raffael Luthiger Oct 22 '11 at 23:39
Agreed, but it's a good first test to make sure the service is running and correctly responding. – David Oct 23 '11 at 8:47
up vote 0 down vote accepted

sudo apt-get install rlinetd did it. I was able to telnet after that.

share|improve this answer
Congratulations, @kamal! You can accept your own answer by clicking on the check mark. – Skyhawk Nov 7 '11 at 0:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.