centos 5.6安裝NTP服務(wù)器
為有些服務(wù)和實(shí)驗(yàn)需要多臺機(jī)器的時(shí)間同步,所以就有了搭建NTP的前提條件了,具體步驟如下:
1,安裝ntp服務(wù)
yum install ntp.i* -y
2,修改/etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery #
restrict -6 default kod nomodify notrap nopeer noquery #針對ipv6設(shè)置
#這是ntp的默認(rèn)設(shè)置
# 允許本地所有操作
restrict 127.0.0.1
restrict -6 ::1
# 允許的局域網(wǎng)絡(luò)段
restrict 10.0.0.0 mask 255.0.0.0 nomodify motrap
restrict 192.168.0.0 mask 255.255.0.0 nomodify motrap
# 使用上層的internet ntp服務(wù)器
restrict 207.46.232.182 mask 255.255.255.255 nomodify notrap noquery
server 207.46.232.182
# 如果無法與上層ntp server通信以本地時(shí)間為標(biāo)準(zhǔn)時(shí)間
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
# 計(jì)算本ntp server 與上層ntpserver的頻率誤差
driftfile /var/lib/ntp/drift
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
#日志文件
logfile /var/log/ntp.log
#說明:
restrict <IP 地址> <子網(wǎng)掩碼> |<網(wǎng)段> <子網(wǎng)掩碼> [ignore|noquery|notrap|nomodiy|notrust|nokod]
ignore :關(guān)閉所有ntp服務(wù)
noquery:不提供ntp服務(wù)
notrap:不提供trap遠(yuǎn)程事件登錄的功能
nomodiy:表示客戶端不能更改ntp服務(wù)器的時(shí)間參數(shù),但可以通過ntp服務(wù)器進(jìn)行時(shí)間矯正
notrust:拒絕沒有通過認(rèn)證的客戶端
nokod:kod技術(shù)可以組織一種dos攻擊
2,在修改/etc/ntp/step-tickers文件
207.46.232.182
127.127.1.0
#當(dāng)ntp服務(wù)器啟動時(shí)自動與這個(gè)文件中的記錄ip進(jìn)行時(shí)間校對
3,修改/etc/sysconfig/ntpd
SYNC_HWCLOCK=YES #允許BIOS與系統(tǒng)時(shí)間同步
4,客戶端設(shè)置略。
新聞熱點(diǎn)
疑難解答