How to get a working clock on Debian 9? Clock is wrong by a couple minutes

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












How to get a working clock in Debian 9 with KDE? My clock is almost 10 minutes slow on multiple of my machines running Debian 9 with KDE and (re)setting the timezone via tzselect didn't work.



(I already solved this but maybe other people would like to have a working clock as well. Also I'm interested in other ways to solve this. I'm surprised this isn't taken care of by the default installation of Debian so that it works right away if you selected the right timezone during installation.)










share|improve this question



























    up vote
    0
    down vote

    favorite












    How to get a working clock in Debian 9 with KDE? My clock is almost 10 minutes slow on multiple of my machines running Debian 9 with KDE and (re)setting the timezone via tzselect didn't work.



    (I already solved this but maybe other people would like to have a working clock as well. Also I'm interested in other ways to solve this. I'm surprised this isn't taken care of by the default installation of Debian so that it works right away if you selected the right timezone during installation.)










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      How to get a working clock in Debian 9 with KDE? My clock is almost 10 minutes slow on multiple of my machines running Debian 9 with KDE and (re)setting the timezone via tzselect didn't work.



      (I already solved this but maybe other people would like to have a working clock as well. Also I'm interested in other ways to solve this. I'm surprised this isn't taken care of by the default installation of Debian so that it works right away if you selected the right timezone during installation.)










      share|improve this question















      How to get a working clock in Debian 9 with KDE? My clock is almost 10 minutes slow on multiple of my machines running Debian 9 with KDE and (re)setting the timezone via tzselect didn't work.



      (I already solved this but maybe other people would like to have a working clock as well. Also I'm interested in other ways to solve this. I'm surprised this isn't taken care of by the default installation of Debian so that it works right away if you selected the right timezone during installation.)







      debian security ntp clock






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 8 hours ago









      Rui F Ribeiro

      38.2k1475123




      38.2k1475123










      asked Nov 18 at 12:00









      mYnDstrEAm

      71941240




      71941240




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          1. Install openntpd: sudo apt-get install openntpd
            ntp did not work and I didn't try Redhat's chrony.



          2. sudo kate /etc/openntpd/ntpd.conf and make sure there are 4 uncommented lines (replace XY with your country code):



            # Choose servers announced from Debian NTP Pool
            servers 0.XY.pool.ntp.org
            servers 1.XY.pool.ntp.org
            servers 2.XY.pool.ntp.org
            servers 3.XY.pool.ntp.org



          3. If you're using iptables add these firewall rules:



            -A INPUT -p udp -m udp --dport 123 -j ACCEPT
            -A INPUT -p udp -m udp --sport 123 -j ACCEPT
            -A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
            -A OUTPUT -p udp -m udp --sport 123 -j ACCEPT`


          4. sudo ntpctl -s status should return .../20 peers valid, clock synced...


          5. (To correct the minutes: ntpd -s. You might have to restart the service: sudo /etc/init.d/openntpd restart)


          6. (Make sure in sudo kate /etc/sysctl.d/99-sysctl.conf it says net.ipv4.tcp_timestamps=0. If it's not set change it and reboot.)


          7. (If you had ntp installed before run sudo apt-get purge ntp. If you're using AppArmor follow the guide in this answer at askubuntu.)






          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482521%2fhow-to-get-a-working-clock-on-debian-9-clock-is-wrong-by-a-couple-minutes%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            1. Install openntpd: sudo apt-get install openntpd
              ntp did not work and I didn't try Redhat's chrony.



            2. sudo kate /etc/openntpd/ntpd.conf and make sure there are 4 uncommented lines (replace XY with your country code):



              # Choose servers announced from Debian NTP Pool
              servers 0.XY.pool.ntp.org
              servers 1.XY.pool.ntp.org
              servers 2.XY.pool.ntp.org
              servers 3.XY.pool.ntp.org



            3. If you're using iptables add these firewall rules:



              -A INPUT -p udp -m udp --dport 123 -j ACCEPT
              -A INPUT -p udp -m udp --sport 123 -j ACCEPT
              -A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
              -A OUTPUT -p udp -m udp --sport 123 -j ACCEPT`


            4. sudo ntpctl -s status should return .../20 peers valid, clock synced...


            5. (To correct the minutes: ntpd -s. You might have to restart the service: sudo /etc/init.d/openntpd restart)


            6. (Make sure in sudo kate /etc/sysctl.d/99-sysctl.conf it says net.ipv4.tcp_timestamps=0. If it's not set change it and reboot.)


            7. (If you had ntp installed before run sudo apt-get purge ntp. If you're using AppArmor follow the guide in this answer at askubuntu.)






            share|improve this answer


























              up vote
              0
              down vote



              accepted










              1. Install openntpd: sudo apt-get install openntpd
                ntp did not work and I didn't try Redhat's chrony.



              2. sudo kate /etc/openntpd/ntpd.conf and make sure there are 4 uncommented lines (replace XY with your country code):



                # Choose servers announced from Debian NTP Pool
                servers 0.XY.pool.ntp.org
                servers 1.XY.pool.ntp.org
                servers 2.XY.pool.ntp.org
                servers 3.XY.pool.ntp.org



              3. If you're using iptables add these firewall rules:



                -A INPUT -p udp -m udp --dport 123 -j ACCEPT
                -A INPUT -p udp -m udp --sport 123 -j ACCEPT
                -A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
                -A OUTPUT -p udp -m udp --sport 123 -j ACCEPT`


              4. sudo ntpctl -s status should return .../20 peers valid, clock synced...


              5. (To correct the minutes: ntpd -s. You might have to restart the service: sudo /etc/init.d/openntpd restart)


              6. (Make sure in sudo kate /etc/sysctl.d/99-sysctl.conf it says net.ipv4.tcp_timestamps=0. If it's not set change it and reboot.)


              7. (If you had ntp installed before run sudo apt-get purge ntp. If you're using AppArmor follow the guide in this answer at askubuntu.)






              share|improve this answer
























                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                1. Install openntpd: sudo apt-get install openntpd
                  ntp did not work and I didn't try Redhat's chrony.



                2. sudo kate /etc/openntpd/ntpd.conf and make sure there are 4 uncommented lines (replace XY with your country code):



                  # Choose servers announced from Debian NTP Pool
                  servers 0.XY.pool.ntp.org
                  servers 1.XY.pool.ntp.org
                  servers 2.XY.pool.ntp.org
                  servers 3.XY.pool.ntp.org



                3. If you're using iptables add these firewall rules:



                  -A INPUT -p udp -m udp --dport 123 -j ACCEPT
                  -A INPUT -p udp -m udp --sport 123 -j ACCEPT
                  -A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
                  -A OUTPUT -p udp -m udp --sport 123 -j ACCEPT`


                4. sudo ntpctl -s status should return .../20 peers valid, clock synced...


                5. (To correct the minutes: ntpd -s. You might have to restart the service: sudo /etc/init.d/openntpd restart)


                6. (Make sure in sudo kate /etc/sysctl.d/99-sysctl.conf it says net.ipv4.tcp_timestamps=0. If it's not set change it and reboot.)


                7. (If you had ntp installed before run sudo apt-get purge ntp. If you're using AppArmor follow the guide in this answer at askubuntu.)






                share|improve this answer














                1. Install openntpd: sudo apt-get install openntpd
                  ntp did not work and I didn't try Redhat's chrony.



                2. sudo kate /etc/openntpd/ntpd.conf and make sure there are 4 uncommented lines (replace XY with your country code):



                  # Choose servers announced from Debian NTP Pool
                  servers 0.XY.pool.ntp.org
                  servers 1.XY.pool.ntp.org
                  servers 2.XY.pool.ntp.org
                  servers 3.XY.pool.ntp.org



                3. If you're using iptables add these firewall rules:



                  -A INPUT -p udp -m udp --dport 123 -j ACCEPT
                  -A INPUT -p udp -m udp --sport 123 -j ACCEPT
                  -A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
                  -A OUTPUT -p udp -m udp --sport 123 -j ACCEPT`


                4. sudo ntpctl -s status should return .../20 peers valid, clock synced...


                5. (To correct the minutes: ntpd -s. You might have to restart the service: sudo /etc/init.d/openntpd restart)


                6. (Make sure in sudo kate /etc/sysctl.d/99-sysctl.conf it says net.ipv4.tcp_timestamps=0. If it's not set change it and reboot.)


                7. (If you had ntp installed before run sudo apt-get purge ntp. If you're using AppArmor follow the guide in this answer at askubuntu.)







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 15 hours ago

























                answered Nov 18 at 12:00









                mYnDstrEAm

                71941240




                71941240



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482521%2fhow-to-get-a-working-clock-on-debian-9-clock-is-wrong-by-a-couple-minutes%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay