CentOS-Stream-10 搭建NTP服务器(一)

CentOS-Stream-10 搭建NTP服务器(一)

服务器端:

1.安装chrony。

yum install chrony -y systemctl start chronyd systemctl enable chronyd systemctl status chronyd

2.配置文件中添加chrony服务器地址和允许时间同步网段。

vim /etc/chrony.conf server 192.168.0.249 iburst allow 192.168.0.0/24

3.启用NTP。

systemctl restart chronyd timedatectl set-ntp true

4.查看时间源。

chronyc sources -v

5.手动同步时间。

chronyc -a makestep

6.防火墙开放NTP服务。

firewall-cmd --permanent --add-service=ntp firewall-cmd --reload

7.显示状态。

timedatectl
ntp enabled: yes ntp synchronized: yes