先设置时区:
# tzsetup
再与国家授时中心服务器对时:
# ntpdate 210.72.145.44
以后自动同步:
首先修改/etc/rc.conf添加ntpd_enable="YES"到最后一行。
然后配置对时服务器:
# vi /etc/ntp.conf
server 210.72.145.44 prefer
server 159.226.154.47
server 127.127.1.0
fudge 127.127.0.1 stratum 5
restrict default ignore
restrict 127.0.0.0 mask 255.0.0.0
restrict 192.168.0.0 mask 255.255.255.0 noquery nopeer notrust
restrict 210.72.145.44 noquery
restrict 159.226.154.47 noquery
driftfile /var/db/ntpd.drift

/var/run/xntpd.pid