yum install chrony -y #centos7默认采用chrony,一般不用再装
vim /etc/chrony.conf
修改下面2行
server ntp.aliyun.com iburst
allow 192.168.10.0/24
systemctl restart chronyd
systemctl enable chronyd
yum install chrony -y
vim /etc/chrony.conf
#修改成server的ip或者主机名
server 192.168.10.41 iburst
systemctl restart chronyd
systemctl enable chronyd
chronyc sources
clock -w
原文:https://www.cnblogs.com/chuangcc/p/12713050.html