CentOS7系列--2.1CentOS7中安装配置NTP服务

CentOS7安装配置NTP服务

NTP服务是时间同步服务

1. 安装NTPd

[root@centos7 ~]# yum install -y ntp

[jack@centos7 ~]$ vi /etc/ntp.conf

添加如下的代码

restrict 192.168.0.0 mask 255.255.0.0 nomodify notrap

更改时间同步服务器

#server 0.centos.pool.ntp.org iburst

#server 1.centos.pool.ntp.org iburst

#server 2.centos.pool.ntp.org iburst

#server 3.centos.pool.ntp.org iburst

server ntp1.jst.mfeed.ad.jp iburst

server ntp2.jst.mfeed.ad.jp iburst

server ntp3.jst.mfeed.ad.jp iburst

[root@centos7 ~]# systemctl start ntpd

[root@centos7 ~]# systemctl enable ntpd

2. 设置防火墙,允许NTP服务使用123/UDP

[root@centos7 ~]# firewall-cmd --add-service=ntp –permanent

[root@centos7 ~]# firewall-cmd –reload

3. 验证

[root@centos7 ~]# ntpq -p

remote refid st t when poll reach delay offset jitter

==============================================================================

*leontp.ccgs.wa. .GPS. 1 u 2 64 15 443.939 -3.250 4.178

+120.25.115.19 10.137.38.86 2 u 62 64 17 49.708 9.697 6.603

+ntp-sz.chl.la 202.118.1.46 2 u 59 64 17 41.490 13.642 5.630

-202.118.176.2 202.118.177.155 4 u 34 64 37 54.802 27.184 4.129

转载于:https://www.cnblogs.com/gispathfinder/p/8833138.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值