Operating System - Linux
1753288 Members
5561 Online
108792 Solutions
New Discussion

work-around for "telnet host 13"

 
tony j. podrasky
Valued Contributor

work-around for "telnet host 13"

Hello Folks;

 

Does anyone know how to get telnet working on a Fedora 16 system?

 

I'll settle for another form of connecting to the box and being able to get the daytime information.

 

regards,

tony j. podrasky

 

REMEMBER: Once you eliminate your #1 problem, #2 gets a promotion.
2 REPLIES 2
Steven Schweda
Honored Contributor

Re: work-around for "telnet host 13"

 
Matti_Kurkela
Honored Contributor

Re: work-around for "telnet host 13"

Your question was very unclear, but I guess you want to get the daytime information from a Fedora 16 system, for whatever reason. You have tried "telnet fedora16host 13" and it did not work. Am I right so far?

 

First: this probably has nothing at all to do with telnet. The name of the service in question is "daytime", and it is usually provided by the (x)inetd daemon. Although xinetd is usually known as a "master server" that starts up the actual service process when needed, daytime is such a simple service that xinetd usually provides it as a built-in service.

 

The telnet client can be used to test many TCP-based services, because it is almost a generic TCP service client. You might just as well use netcat ("nc") instead of telnet, or anything that can establish a TCP connection and display incoming data as-is to standard output.

 

As the daytime service is not used very often, it is probably disabled by default, and if you're using Fedora 16's default iptables firewall settings, the firewall will probably stop you from accessing the daytime service even if the service is enabled.

 

This brings us to the second problem with your question: the actual error message would have been very helpful here.

 

If the "telnet host 13" command hangs for a minute or so and then displays a "Connection timed out" error, it is likely that you have a problem with the iptables firewall settings: the firewall is causing your request to be completely ignored, irrespective of the status of the actual daytime service. On the other hand, if the command immediately produces a "Connection refused" error, you would be getting through the firewall (or the firewall is disabled), but there is no daytime service running.

 

To fix:

  • First, make sure the xinetd RPM is installed (run "yum install xinetd" or use your favorite package management tool to install it if it is not installed)
  • Then, make sure the daytime service is enabled: run "chkconfig --list". You should see a list of services, and a smaller list titled "xinetd based services" at the end. In the "xinetd based services", there should be actually two daytime services: daytime-dgram and daytime-stream. The first one is an UDP-based version of the daytime service, which is even more rare. The TCP-based version (which is accessible by commands like "telnet host 13" is called "daytime-stream". To enable it, run "chkconfig daytime-stream on".
  • Now test again. If it still fails with a "Connection timed out" error, you'll need to edit your firewall settings. Your goal is to allow incoming connections to TCP port 13; I'm not very familiar with Fedora 16 so I don't know exactly what firewall configuration tools are available in it. You may have more user-friendly tools available (try "system-config-firewall"), but if you can't find any, this command should work in any system that is using iptables:
iptables -I INPUT 1 -p tcp --dport 13 -j ACCEPT

 This should allow the daytime service to work, but the setting will be gone after a reboot unless the new iptables settings are saved. If Fedora 16 uses the same mechanism for storing the iptables rules as RHEL 6, you could make the new settings permanent like this:

 

cp /etc/sysconfig/iptables /etc/sysconfig/iptables.orig
iptables-save >/etc/sysconfig/iptables

 The first command will backup the old settings, the second will write the current iptables rules to the file.

MK