1.确定是否安装ntp
ntpq -p
2.如果没有安装,执行以下命令
apt install ntp
3.修改配置
sudo vim /etc/ntp.conf
在末尾新增:
server 127.127.1.0
fudge 127.127.1.0 stratum 8
restrict 0.0.0.0 mask 255.255.255.255 nomodify notrap
保存并退出
4.重启ntp服务
sudo systemctl restart ntp