ntp
sudo ntpdate time.nist.gov
sudo hwclock --systohc
sudo hwclock --show
timedatectl status
ntpdc -c sysinfo
systemctl status ntpd.service
systemctl status systemd-timesyncd.service
Use only one service, either systemd-timesyncd
or ntpd
.
systemd-timesyncd
is more lightweight and is a client only (which I personally prefer), but it doesn’t train the system’s clock.
systemd-timesyncd is basically a small client-only NTP implementation more or less bundled with newer systemd releases. It’s more lightweight than a full ntpd but only supports time sync - i.e. it can’t act as an NTP server for other machines. It’s intended to replace ntpd for clients.
systemd-timesyncd does no clock discipline: the clock is not trained or compensated, and internal clock drift over time is not reduced. It has rudimentary logic to adjust poll interval but without disciplining the host will end up with uneven time forever as systemd-timesyncd pushes or pulls at whatever interval it thinks the near-term drift requires.
systemctl disable ntpd.service
systemctl stop ntpd.service
systemctl start systemd-timesyncd.service
systemctl enable systemd-timesyncd.service
timedatectl set-ntp 1