公司的一臺服務器硬件壞了掛了,其中就有ntp服務端,寫一下ntp服務端的簡單配置。
1、首先安裝ntp,centos 系統執行 yum install ntp
2、寫入配置文件/etc/ntp.conf如下
restrict 192.168.18.153 mask 255.255.255.0 nomodify notrap
restrict 192.168.18.0 mask 255.255.255.0 nomodify
server time.pool.aliyun.com
#server 127.127.1.0
server用的是阿里雲的ntp服務器。
3、首次配置服務器需要一定的時間去server同步時間,執行ntpq -p查看是否同步成功
4、同步成功之後,同一個內網的就可以執行ntpdate 192.168.18.153來同步時間