linux下ntp時間服務器配置及客戶端注意事項
折騰了半天,裏標記一下,以備後用。
一、同步環境
1、ntp客戶端:windows7,關閉了防火牆,ip:192.168.1.101
2、ntp服務端:windows7下虛擬機redhat5.5,關閉了防火牆+selinux,ip:192.168.1.105
二、NTP服務端步驟:
1、cd /etc && cp ntp.conf ntp.bak.conf
2、vi ntp.conf
(1)找到restrict開始的部分,刪除之,改為以下三行:
restrict default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict 192.168.1.0 mask 255.255.255.0 nomodify
restrict 127.0.0.1
restrict 192.168.1.0 mask 255.255.255.0 nomodify
(2)找到:
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (https://www.pool.ntp.org/join.html).
添加以下3條NTP時間服務器
server s1b.time.edu.cn
server s1a.time.edu.cn
server 210.72.145.44
參考:國內常用NTP服務器地址及IP:https://www.douban.com/note/171309770/
保存ntp.conf,執行:service ntpd restart
三、windows客戶端操作
1、客戶端“開始”,搜索裏輸入gpedit.msc,然後回車
圖1
打開如下窗口:
圖2
2、單擊“配置windows ntp客戶端”,在打開的窗口裏,選擇“啟用”,然後修改下麵的選項框:NtpServer:192.168.1.105(也就是服務端ip),類型:NTP,然後保存。

圖3
3、回到圖2對話框,單擊“啟用windows ntp客戶端”,如果選項框是空白,點擊右上方的“上一個配置”。

圖4
然後,可以看到下圖5,單擊“確定”保存。

4、把客戶端時間與服務端時間修改誤差大一些,測試的時候可以更好的看到效果。
雙擊任務欄最右邊的時間,打開“日期和時間”,切換到“Internet時間”-“更改設置”,在服務器一欄裏輸入:192.168.1.105,然後“立即更新”,不出意外的話,接著會看到更新成功的提示。
最後更新:2017-04-03 12:55:46