安裝 ntp 伺服器yum install ntp tzdata
chkconfig ntpd on
# ntp: 就是 NTP 伺服器的主要軟體啦,包括設定檔以及執行檔等等。
# tzdata: 軟體名稱為『 Time Zone data 』的縮寫,提供各時區對應的顯示格式。
編輯 /etc/ntp.conf:
# 拒絕 IPv4 restrict default kod nomodify notrap nopeer noquery # 拒絕 IPv6 restrict -6 default kod nomodify notrap nopeer noquery # 放行指定的主機,一般會填寫上層 NTP Server restrict your.time.server # 放行 tock.stdtime.gov.tw 進入本 NTP 伺服器restrict 220.130.158.71# 放行 tick.stdtime.gov.tw 進入本 NTP 伺服器 restrict 59.124.196.83# 放行 time.stdtime.gov.tw 進入本 NTP 伺服器 restrict 59.124.196.84 # 預設放行本機 restrict 127.0.0.1 restrict -6 ::1 # 放行指定的私有網路主機 restrict 192.168.100.0 mask 255.255.255.0 nomodify # ignore: 拒絕所有類型的 NTP 連線;
# nomodify: 用戶端不能使用 ntpc 與 ntpq 這兩支程式來修改伺服器的時間參數, 但用戶端仍可透過這部主機來進行網路校時的;
# noquery: 用戶端不能夠使用 ntpq, ntpc 等指令來查詢時間伺服器,等於不提供 NTP 的網路校時囉;
# notrap: 不提供 trap 這個遠端事件登錄 (remote event logging) 的功能。
# notrust: 拒絕沒有認證的用戶端。 # 設定上層 NTP Server # 原本的 [0|1|2].centos.pool.ntp.org 的可以註解掉 server your.time.server server 220.130.158.71 prefer <==以這部主機為最優先
server 59.124.196.83
server 59.124.196.84# 預設時間差異分析檔案與暫不用到的 keys 等 driftfile /var/lib/ntp/driftkeys /etc/ntp/keys文章標籤
全站熱搜
