码迷,mamicode.com
首页 > 其他好文 > 详细

RHEL 7.6 设置时间同步ntp

时间:2019-10-30 16:22:53      阅读:817      评论:0      收藏:0      [点我收藏+]

标签:class   状态   enable   重启   str   yum   systemctl   sys   etc   

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

 

RHEL 7.6 设置时间同步ntp

标签:class   状态   enable   重启   str   yum   systemctl   sys   etc   

原文地址:https://www.cnblogs.com/ericnie/p/11765430.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!