How to enable daytime service on ubuntu

9,884

/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:
9,884

Related videos on Youtube

q0987
Author by

q0987

Updated on September 18, 2022

Comments

  • q0987
    q0987 over 1 year

    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

    • q0987
      q0987 over 12 years
      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.
    • Admin
      Admin over 12 years
      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?
    • q0987
      q0987 over 12 years
      @andrewdski, No, I don't understand why it is disabled. May you explain a little for me?
    • user1686
      user1686 over 12 years
      One reason is that time and daytime have been useless ever since NTP was created.
    • andrewdski
      andrewdski over 12 years
      It is disabled because it is vulnerable to denial of service attacks. See for example: descriptions.netvigilance.com/tc/15039.
  • user3540003
    user3540003 over 12 years
    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.