美文网首页
CentOS下设置NTP时间同步服务器

CentOS下设置NTP时间同步服务器

作者: 请叫我翟先生 | 来源:发表于2018-08-10 10:51 被阅读28次
    1. 安装ntp服务
      yum install ntp
    2. 配置config
      vi /etc/ntp.conf
      restrict 192.168.5.0 mask 255.255.255.0 nomodify notrap #允许该网段内的主机可以进行校时
      restrict 0.0.0.0 mask 0.0.0.0 nomodify notrap #允许任何主机跟进行时间同步
      restrict default #default指所有的IP
      restrict 192.168.10.2  # 指定某台机器时间同步
      配置时间源
      server pool.ntp.org #可选择其他优先服务器
      server 0.pool.ntp.org
      server 1.pool.ntp.org
      server 2.pool.ntp.org
    3. 配置防火墙123端口开放
      iptables -I INPUT -p udp --dport 123 -j ACCEPT
      /etc/init.d/iptables save
      service iptables restart
    4. 开启服务
      chkconfig ntpd on #设置为开机启动
      /etc/init.d/ntpd start #启动NTP服务器
      /etc/init.d/ntpd stop #关闭NTP服务器
      /etc/init.d/ntpd restart #重启NTP服务器

    附参考目录:
    https://www.linuxidc.com/Linux/2014-01/95258.htm
    https://blog.csdn.net/wunianjiumeng/article/details/79070326
    https://www.cnblogs.com/2018shawn/p/9022425.html
    https://blog.csdn.net/wangcg123/article/details/53693935
    https://www.cnblogs.com/zwingblog/p/6110588.html

    相关文章

      网友评论

          本文标题:CentOS下设置NTP时间同步服务器

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