Translation(s): English - Español - French - Italiano - Português (Brasil) - Українська
NTP' is a way to automatically set your system's clock (time and date) to an accurate value over the internet. NTP stands for Network Time Protocol. Your computer can be a client (sets its clock from others) or a server (tells other systems what the time should be)
Contents
Intro
Computers need accurate time because (WHY?)
To see what your system thinks the current date and time is, run the following (the -R ensures you see the timezone)
date -R
systemd-timescyncd
systemd provides systemd-timesyncd.8 which is a simple NTP client. If it is not installed, run
apt install systemd-timesyncd
and it will set the clock on your system. This is likely to be enough for most users.
Run
systemctl status systemd-timesyncd.service
to check it is working. See Freedesktop.org's page on timesyncd for more details.
ntpsec
An NTP daemon is required only when you want to run an NTP server, ie share the time from your computer to other systems.
You can install the ntpsec package with
apt install ntpsec
To use it:
Type ntpq -p to see servers you are syncing with.
Type date again to see if the time changed. Your time should be synced in a next minute.
Some upstream documentation is available at:
Troubleshooting ntpsec
If you run ntpq -p and you get
No association ID's returned
run
dpkg-reconfigure ntp
And then you should see something like:
ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp.pbx.org xx.xxx.xxx.xxx 2 u - 64 1 33.763 1799619 1.054
xray.metadom.co xx.xxx.xxx.xxx 2 u 1 64 1 40.367 1799619 0.001
hydrogen.cert.u xx.xxx.xxx.xxx 2 u - 64 1 64.740 1799619 0.001
mirror .INIT. 16 u - 64 0 0.000 0.000 0.001
Public Internet Time Servers
The Debian package will install a default set of time servers which should be good for most typical client installations. However you may customize this for your network location. A good source of NTP pool information is the NTP Pool Project.
See also
CategoryNetwork CategorySoftware CategorySystemAdministration
