2011/09/20

快速架設 NTP Server

yum install ntp tzdata
chkconfig ntpd on
編輯 /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

# 預設放行本機
restrict 127.0.0.1
restrict -6 ::1

# 放行指定的私有網路主機
restrict 192.168.100.0 mask 255.255.255.0 nomodify

# 設定上層 NTP Server 
# 原本的 [0|1|2].centos.pool.ntp.org 的可以註解掉
server your.time.server

# 預設時間差異分析檔案與暫不用到的 keys 等
driftfile /var/lib/ntp/drift
keys      /etc/ntp/keys
/etc/init.d/ntpd restart
Reference:
http://linux.vbird.org/linux_server/0440ntp.php#server