安装 systemd-timesyncd

如果已经按照 ntp,则先卸载:

# apt purge ntp

然后安装:

# apt install systemd-timesyncd

配置

编辑 /etc/systemd/timesyncd.conf,在 NTP= 处填写可靠的 NTP 服务器,如:

NTP=time.apple.com time.google.com time.windows.com

启动、验证

启动命令:

# systemctl start systemd-timesyncd

验证:

# systemctl status systemd-timesyncd

# timedatectl