2018年8月24日 星期五

NTP安裝設定

1.若沒NTP服務請先安裝
#yum install ntp

2.設定/etc/ntp.conf
# 1. 先處理權限方面的問題,包括放行上層伺服器以及開放區網用戶來源:
restrict default kod nomodify notrap nopeer noquery     <==拒絕 IPv4 的用戶
restrict -6 default kod nomodify notrap nopeer noquery  <==拒絕 IPv6 的用戶
restrict tock.stdtime.gov.tw   <==放行 tock.stdtime.gov.tw 進入本 NTP 伺服器
restrict tick.stdtime.gov.tw
restrict time.stdtime.gov.tw
restrict 127.0.0.1
restrict -6 ::1
#restrict 192.168.1.0 mask 255.255.255.0 nomodify

# 2. 設定主機來源,請先將原本的 [0|1|2].centos.pool.ntp.org 的設定註解掉:
server tock.stdtime.gov.tw prefer  <==以這部主機為最優先
server tick.stdtime.gov.tw
server time.stdtime.gov.tw

# 3.預設時間差異分析檔案與暫不用到的 keys 等,不需要更動它:
driftfile /var/lib/ntp/drift
keys      /etc/ntp/keys

3.啟動NTP服務
#systemctl start ntpd

4.將NTP預設起動
#chkconfig ntpd on

沒有留言:

張貼留言