资讯详情

Rocky|NTP服务

📅 2026/10/8 1:23:10 | 华诺云谱 👁 阅读
Rocky|NTP服务
服务端vi /etc/chrony.conf 编辑指定目录文件pool 2.pool.ntp.org iburst 《将2.pool.ntp.org改为自己的ip#Use NTP servers from DHCP.sourcedir /run/chrony-dhcp#Record the rate at which the system clock gains/losses time.driftfile /var/lib/chrony/drift#Allow the system clock to be stepped in the first three updates#if its offset is larger than 1 second.makestep 1.0 3#Enable kernel synchronization of the real-time clock (RTC).rtcsync#Enable hardware timestamping on all interfaces that support it.#hwtimestamp *#Increase the minimum number of selectable sources required to adjust#the system clock.#minsources 2#Allow NTP client access from local network.#allow 192.168.0.0/16 《删掉注释#号#Serve time even if not synchronized to a time source.#local stratum 10 《删掉注释#号systemctl restart chronyd重启服务服务 重启服务名称systemctl enable chronyd开启服务的自启动systemctl start firewalld启动指定服务firewall-cmd --zonepublic --add-port123/udp --permanent对外开放端口firewall-cmd --reload:重载防火墙配置firewall-cmd --list-ports查看当前开放的端口chronyc sources -v查看时间服务器的状态客户端只用将2.pool.ntp.org改为服务端的ipvi /etc/chrony.confpool 192.168.204.129 iburst#Use NTP servers from DHCP.sourcedir /run/chrony-dhcp#Record the rate at which the system clock gains/losses time.driftfile /var/lib/chrony/drift#Allow the system clock to be stepped in the first three updates#if its offset is larger than 1 second.makestep 1.0 3#Enable kernel synchronization of the real-time clock (RTC).rtcsync#Enable hardware timestamping on all interfaces that support it.#hwtimestamp *#Increase the minimum number of selectable sources required to adjust#the system clock.#minsources 2#Allow NTP client access from local network.#allow 192.168.0.0/16#Serve time even if not synchronized to a time source.#local stratum 10systemctl restart chronyd重启服务服务 重启服务名称chronyc sources -v查看时间服务器的状态
📝

华诺云谱内容团队

资深建站顾问 · 行业研究员

10年+企业数字化服务经验,专注智能建站、SEO优化与品牌营销,持续输出建站技巧、行业洞察与营销干货,已帮助5000+企业实现数字化增长。

你可能需要的服务

订阅华诺云谱资讯周报

每周一封,精选建站技巧、SEO与营销干货,直达邮箱。已有 8,000+ 企业主订阅,助你少走弯路。

↑