yuanqiao 发表于 2018-5-17 10:08:42

linux服务ntp

  NTP服务器
  

  NTP --------- Network Time Protocol 网络时间协议
  

  

  软件: ntp
  配置文件:/etc/ntp.conf
  服务:ntpd
  端口:123/udp
  

  示例:配置ntp时间服务器
  

  1) 安装ntp软件
  

  # yum install -y ntp
  

  2) 编辑ntp配置文件
  

  # vim /etc/ntp.conf
  

  restrict 192.168.87.0 mask 255.255.255.0 nomodify
  

  server 127.127.1.0 iburst
  fudge 127.127.1.0 stratum 10
  

  

  

  # systemctl start ntpd
  # systemctl enable ntpd
  Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
  #
  # ss -anup | grep :123
  UNCONN   0      0      192.168.124.1:123                      *:*                   users:(("ntpd",pid=6092,fd=20))
  UNCONN   0      0      192.168.87.101:123                      *:*                   users:(("ntpd",pid=6092,fd=19))
  

  

  3) 关闭SELinux和防火墙
  

  

  客户端测试:
  

  # ntpdate 192.168.87.101
  11 Nov 12:15:19 ntpdate: adjust time server 192.168.87.101 offset -0.001224 sec
  #
  
页: [1]
查看完整版本: linux服务ntp