RHEL 7.6 设置时间同步ntp


1.服务端和客户端

安装包,检查状态

yum install ntp ntpdate -y

systemctl start ntpd
systemctl status ntpd

2.服务端

修改配置

vi /etc/ntp.conf

#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst

server 127.127.1.0
fudge 127.127.1.0 stratum 10

 

重启服务,并查看

systemctl start ntpd

ntpq -p

3.客户端

修改配置

vi /etc/ntp.conf

restrict 192.168.7.1 nomodify notrap noquery

server 192.168.7.1  Fudge 192.168.7.1  stratum 10
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst
#server 3.rhel.pool.ntp.org iburst

 

systemctl restart ntpd

ntpdate -u 192.168.7.1

ntpq -p

systemctl enable ntpd

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM