一、安装 Chrony
运行dnf-y install chrony安装 chrony。
二、修改 Chrony 配置
Chrony 的配置文件是/etc/chrony.conf,通过 vim 打开它并修改server上游NTP服务器配置。
server ntp.ntsc.ac.cn iburst
server ntp.aliyun.com iburst

再取消local stratum及allow的注释,并修改allow的值,我这里使用all运行所有客户端链接。
local stratum表示允许在断网没有可用NTP上游的情况下依旧提供NTP服务。

三、防火墙放行
NTP服务使用123端口,需要防火墙放行之。
firewall-cmd --add-service=ntp --permanent
firewall-cmd --reload
四、启动 Chrony
运行下述命令启动 Chrony 并设置开机自启。
systemctl enable chronyd
systemctl start chronyd

文章评论