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