centos 5.6安裝NTP伺服器 為有些服務和實驗需要多台機器的時間同步,所以就有了搭建NTP的前提條件了,具體步驟如下:1,安裝ntp服務yum install ntp.i* -y2,修改/etc/ntp.confrestrict default kod nomodify notrap nopeer noquery #restrict -6 default kod nomodify notrap nopeer noquery #針對ipv6設定#這是ntp的預設設定 www.2cto.com # 允許本地所有操作restrict 127.0.0.1 restrict -6 ::1 # 允許的區域網路絡段restrict 10.0.0.0 mask 255.0.0.0 nomodify motraprestrict 192.168.0.0 mask 255.255.0.0 nomodify motrap # 使用上層的internet ntp伺服器restrict 207.46.232.182 mask 255.255.255.255 nomodify notrap noqueryserver 207.46.232.182 # 如果無法與上層ntp server通訊以本地時間為標準時間server 127.127.1.0 # local clockfudge 127.127.1.0 stratum 10 # 計算本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 位址> <子網路遮罩> |<網段> <子網路遮罩> [ignore|noquery|notrap|nomodiy|notrust|nokod]ignore :關閉所有ntp服務 www.2cto.com noquery:不提供ntp服務notrap:不提供trap遠程事件登入的功能nomodiy:表示用戶端不能更改ntp伺服器的時間參數,但可以通過ntp伺服器進行時間矯正notrust:拒絕沒有通過認證的用戶端nokod:kod技術可以組織一種dos攻擊 2,在修改/etc/ntp/step-tickers檔案207.46.232.182127.127.1.0#當ntp伺服器啟動時自動與這個檔案中的記錄ip進行時間校對 3,修改/etc/sysconfig/ntpdSYNC_HWCLOCK=YES #允許BIOS與系統時間同步 4,用戶端設定略。