sudo apt-get install ntp2.然后备份并配置ntp.conf,并重启
sudo cp /etc/ntp.conf /etc/ntp_backup.conf sudo gedit /etc/ntp.conf #修改内容 sudo service ntp restart
配置如下xiugaineir
其中红色部分为修改的内容:
配置NTP服务器池(第一个框)
broadcast根据自己的ip填,末尾是255(第二个框)
sudo apt install ufw sudo ufw allow from any to any port 123 proto udp4.从机配置ntp客户端
sudo apt-get install ntp sudo apt-get install ntpdate
开始同步
sudo ntpdate xxx.xxx.xxx.xxx #(主机ip)



