第二方法:时间服务器:
1) #yum install ntp
2)# vi /etc/ntp.conf
注释一行
restrict default ignore
加入一行
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap #服务器的地址
3). # vi /etc/ntp/step-tickers
加入一行(也可以在原有基础上改写)
pool.ntp.org
这样每次ntpd启动时,会自动连接该国际标准时间服务器;
4). # systemctl restart ntpd
5). # ss -an |grep 123
确保该端口以udp方式开放
6)# systemctl enable ntpdate.service (加入开机自启动)
7)# date (检测时间是否靠谱)
2016年 01月 18日 星期一 00:43:55 CST