linux时间设置
server服务器搭建
关闭防火墙与selinux
centos安装 yum install ntp -y
编辑/etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
server ntp.aliyun.com # NTP 服务器IP
restrict nb nomodify notrap noquery
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 8
client客户端
yum install ntpdate -y
ntpdate ntp1.aliyun.com
可以设置自动更新
crontab -e
*/30 * * * * /usr/sbin/ntpdate ntp1.aliyun.com >>/dev/null