ubuntu 下ntp sever 安装及配置

2019-08-03  本文已影响0人  __若只如初见
  1. 安装
    sudo apt-get install ntp
  2. 配置成和本机同步时间
# /etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift 
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
#ntp server update with it self
server 127.127.1.0
fudge 127.127.1.0 stratum 5
#do not alow remote ipv4 and ipv6
restrict -4 default kod notrap nomodify nopeer noquery 
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
  1. 重启
    service ntp restart
  2. 查看ntp服务器与上层ntp的状态
    ntpq -p
上一篇 下一篇

猜你喜欢

热点阅读