Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have found the following info on my machine

user@ubuntu:/etc/xinetd.d$ cat daytime
# default: off
# description: An internal xinetd service which gets the current system time
# then prints it out in a format like this: "Wed Nov 13 22:30:27 EST 2002".
# This is the tcp version.
service daytime
{
    disable     = yes
    type        = INTERNAL
    id      = daytime-stream
    socket_type = stream
    protocol    = tcp
    user        = root
    wait        = no
}                                                                               

# This is the udp version.
service daytime
{
    disable     = yes
    type        = INTERNAL
    id      = daytime-dgram
    socket_type = dgram
    protocol    = udp
    user        = root
    wait        = yes
} 

Question:

How to enable the daytime service?

// Update // I have problems to do the step2

Step 1:

sudo aptitude install xinetd

Step 2: Next you'll need to enable the daytime and echo services by editing their config files in /etc/xinetd.d (you should only need to change the disable option from yes to no)

Step 3: sudo invoke-rc.d xinetd reload

share|improve this question

migrated from stackoverflow.com Jul 17 '11 at 17:19

This question came from our site for professional and enthusiast programmers.

    
I have tried to directly modify the file /etc/xinetd.d/daytime and change the disable yes to no. But I am not able to save it. –  q0987 Jul 17 '11 at 16:29
2  
You need to invoke the editor with sudo as well, so that you have permission to save the file. Also, you do understand why the daytime service is disabled right? –  andrewdski Jul 17 '11 at 16:42
    
@andrewdski, No, I don't understand why it is disabled. May you explain a little for me? –  q0987 Jul 17 '11 at 17:16
    
One reason is that time and daytime have been useless ever since NTP was created. –  grawity Jul 17 '11 at 17:32
1  
It is disabled because it is vulnerable to denial of service attacks. See for example: descriptions.netvigilance.com/tc/15039. –  andrewdski Jul 17 '11 at 18:04

1 Answer 1

up vote 1 down vote accepted

/etc/xinetd.d/* is only writable by root. You can copy it to your home directory (cp /etc/xinetd.d/daytime ~), edit that, and then copy it back with root permission (sudo cp ~/daytime /etc/xinetd.d). Or you can edit it in-situ with an editor you trust to run as root, a la sudo someeditor /etc/xinetd.d/daytime.

share|improve this answer
1  
You can automate the first approach as sudo -e /etc/xinetd.d/daytime , which will invoke an editor as you, not root, on a copy. –  Kevin Reid Jul 17 '11 at 18:24

Your Answer

 
discard

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.