NTP port is blocked. How to sync time? – 18.04

My server provider blocked NTP port because they said there was an NTP attack. Now I cannot sync date and time in my ubuntu 18.04 server.

How can I sync time?

This is ntpdate -q 0.pool.ntp.org result:

server 195.50.171.101, stratum 0, offset 0.000000, delay 0.00000
server 176.235.41.255, stratum 0, offset 0.000000, delay 0.00000
server 86.108.190.23, stratum 0, offset 0.000000, delay 0.00000
server 178.79.155.116, stratum 0, offset 0.000000, delay 0.00000
14 Nov 04:51:06 ntpdate[4027]: no server suitable for synchronization found

This is timedatectl result:

                      Local time: Sat 2020-11-14 05:22:44 EST
                  Universal time: Sat 2020-11-14 10:22:44 UTC
                        RTC time: Sat 2020-11-14 09:55:35
                       Time zone: America/New_York (EST, -0500)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
Asked By: uzaysan

||

You can try the htpdate package. It has a service called htpdate.service.

After installing htpdate with the command sudo apt install htpdate you can monitor its status using the following command:

$ systemctl status htpdate.service

Please, note that this service will not be able to synchronize your clock very precisely, however an error of about one second will be acceptable in your case.

Answered By: FedKad
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.