当前位置: 代码迷 >> 综合 >> rhel6.5:搭建ntp时间服务器
  详细解决方案

rhel6.5:搭建ntp时间服务器

热度:70   发布时间:2023-10-18 13:18:11.0
server:1、首先查看是否安装ntp包# rpm -qa | grep ntpntp-4.2.6p5-1.el6.x86_64fontpackages-filesystem-1.41-1.1.el6.noarchntpdate-4.2.6p5-1.el6.x86_642、修改配置ntp.conf文件(配置文件可以直接全部拷贝过去)# cat /etc/ntp.confdriftfile /var/lib/ntp/driftrestrict default kod nomodify notrap nopeer noqueryrestrict -6 default kod nomodify notrap nopeer noqueryrestrict 127.0.0.1restrict -6 ::1restrict 20.0.0.0 mask 255.255.255.0 nomodify notrapserver 20.20.20.41server 0.rhel.pool.ntp.org iburstserver 1.rhel.pool.ntp.org iburstserver 2.rhel.pool.ntp.org iburstserver 3.rhel.pool.ntp.org iburstserver 0.cn.pool.ntp.orgserver 1.cn.pool.ntp.orgserver 2.cn.pool.ntp.orgserver 3.cn.pool.ntp.orgserver  127.127.1.0fudge   127.127.1.0 stratum 10includefile /etc/ntp/crypto/pwkeys /etc/ntp/keys3、启动ntp服务# /etc/init.d/ntpd start# chkconfig ntpd onclient:1、首先查看是否安装ntp包# rpm -qa | grep ntpntp-4.2.6p5-1.el6.x86_64fontpackages-filesystem-1.41-1.1.el6.noarchntpdate-4.2.6p5-1.el6.x86_642、同步时间ntpdate 服务器IP或者域名

 

参考文档:https://blog.csdn.net/qq_34889607/article/details/82150697