生活随笔
收集整理的這篇文章主要介紹了
[简洁版] CentOS NTP服务器搭建
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝ntp服務器
yum
install -y ntp
關閉CentOS自帶的chrony
systemctl stop chronyd.service
systemctl disable chronyd.service
修改ntp服務器配置文件
cat
>/etc/ntp.conf
<<'EOF'
driftfile /var/lib/ntp/drift
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
#restrict default nomodify notrap nopeer noquery
#允許本機訪問
restrict 127.0.0.1
restrict ::1
#允許所有網段訪問
restrict 0.0.0.0 netmask 0.0.0.0 nomodify nostrap
#上游時間服務器
server ntp.aliyun.com iburst
#上游時間服務器不可訪問是,以本地為準正常運行提供ntp服務
server 127.127.1.0
fudge 127.127.1.0 stratum 10
disable monitor
#設定監聽接口
interface listen 172.22.10.6
interface listen 127.0.0.1
EOF
sudo systemctl restart ntpd
手動更新時間
ntpdate
-u -s ntp.aliyun.com
開通防火墻NTP端口
sudo firewall-cmd --add-service
=ntp
--permanent
sudo firewall-cmd
--reload
總結
以上是生活随笔為你收集整理的[简洁版] CentOS NTP服务器搭建的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。