chronyd 时间同步

chronyd 时间同步

chrony 服务器

yum -y install chrony
cp /etc/chrony.conf{,.bak}
#备份默认配置
cat > /etc/chrony.conf << EOF
##外部NTP服务器
server ntp6.aliyun.com iburst
server cn.ntp.org.cn iburst
server ntp.shu.edu.cn iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
##内网可以访问段 allow 可为多个
#allow 10.10.0.0/16
allow 192.168.4.0/24
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
noclientlog
logchange 0.5
logdir /var/log/chrony
EOF

chrony 用户

yum -y install chrony
sed -i 's/server/#server/' /etc/chrony.conf
echo "server 192.168.4.44" >> /etc/chrony.conf
systemctl start chronyd
systemctl enable chronyd

查看时间同步源

chronyc sources -v
chronyc sourcestats -v 

你可能感兴趣的:(Linux)