1、安裝。
yum install -y ntp
2、開機啟動。
chkconfig ntpd on
3、配置。
vim /etc/ntp.conf
修改restrict default kod nomodify notrap nopeer noquery
變成restrict default nomodify notrap
添加以下這行,其中192.168.0.0 netmask是允許連接配接此伺服器的ip段
restrict 192.168.0.0 netmask 255.255.0.0 nomodify notrap
儲存退出
4、重新開機服務。
/etc/init.d/ntpd restart
5、防火牆放行。
vim /etc/sysconfig/iptables
-A INPUT -s 192.168.0.0/16 -j ACCEPT
本文轉自 朱科強 51CTO部落格,原文連結:http://blog.51cto.com/zhukeqiang/1928995,如需轉載請自行聯系原作者