RHEL 7.6 設置時間同步ntp

1.服務端和客戶端

安裝包,檢查狀態spa

yum install ntp ntpdate -y

systemctl start ntpd
systemctl status ntpd

2.服務端

修改配置rest

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

 

重啓服務,並查看code

systemctl start ntpd

ntpq -p

3.客戶端

修改配置server

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
相關文章
相關標籤/搜索