美文网首页
ubuntu 下ntp sever 安装及配置

ubuntu 下ntp sever 安装及配置

作者: __若只如初见 | 来源:发表于2019-08-03 15:27 被阅读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

相关文章

网友评论

      本文标题:ubuntu 下ntp sever 安装及配置

      本文链接:https://www.haomeiwen.com/subject/lpvjdctx.html