CentOS 使用 Chrony 搭建 NTP 服务器

2018年3月18日 685点热度 0人点赞 0条评论

一、安装 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 stratumallow的注释,并修改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

耗子

练习时长 4 年半的个人程序员 喜欢PHP、Go、Vue 和 Python Music~

文章评论

Loading...