哪个公司网站做的最好,discuz应用,网页设计版权信息代码,苏州网站建设姜超NTP 时间服务器 ntp也是一种协议 ntp软件#xff08;支持ntp协议#xff09; CentOS6自带 CentOS7需要安装 chrony软件#xff08;支持ntp协议#xff09; CentOS7自带 安装ntp CentOS6系统自带ntp#xff0c;CentOS7需要自己安装 [rootm02 ~]# yum -y install ntp
[ro…NTP 时间服务器 ntp也是一种协议 ntp软件支持ntp协议 CentOS6自带 CentOS7需要安装 chrony软件支持ntp协议 CentOS7自带 安装ntp CentOS6系统自带ntpCentOS7需要自己安装 [rootm02 ~]# yum -y install ntp
[rootm02 ~]# rpm -qa ntp
ntp-4.2.6p5-25.el7.centos.2.x86_64 配置ntp 权限参数含义 noquery不提供ntp服务
notrap不提供trap远程事件登录的功能
nomodiy表示客户端不能更改ntp服务器的时间参数但可以通过ntp服务器进行时间矫正
notrust拒绝没有通过认证的客户端
nokodkod技术可以组织一种dos攻击
ignore :关闭所有ntp服务 配置文件更改 更改之前可以备份一下以防改错 [rootm02 ~]# vim /etc/ntp.conf
server ntp1.aliyun.com 加上这个因为默认是国外的时间同步服务器使用国外的相对于使用阿里的速度对比可想而知。 加权限限制 格式restrict IP 权限参数
IP可以为ip地址或者default
权限参数nomodify notrap nopeer noquery
例如restrict 172.16.1.0 mask 255.255.255.0 nomodify notrap ntp服务改后和改前配置文件对比 [rootm02 ~]# diff /etc/ntp.conf{,.ori}
18c18restrict 172.16.1.0 mask 255.255.255.0 nomodify notrap
---21d20server ntp1.aliyun.com 启动ntp [rootm02 ~]# systemctl start ntpd 服务端可以先查看一下 利用ntpq -p命令和ntpstat命令 [rootm02 ~]# ntpq -p #显示上一级连接的服务器remote refid st t when poll reach delay offset jitter*time5.aliyun.co 10.137.38.86 2 u 57 64 377 4.209 3.841 2.685time-d-b.nist.g .STEP. 16 u - 512 0 0.000 0.000 0.000
[rootm02 ~]# ntpstat #显示同步结果 现在的状态信息
synchronised to NTP server (182.92.12.11) at stratum 3 time correct to within 11 mspolling server every 64 s 客户端测试结果 客户机要等几分钟再与新启动的ntp服务器进行时间同步否则会提示no server suitable for synchronization found错误。 而且同步有时会很慢 ntpdate -d 显示同步过程 [rootCobbler ~]# ntpdate 172.16.1.62
16 Nov 11:42:34 ntpdate[1538]: adjust time server 172.16.1.62 offset -0.002221 sec
[rootCobbler ~]# ntpdate -d 172.16.1.62
16 Nov 16:10:07 ntpdate[2058]: ntpdate 4.2.6p51.2349-o Wed Apr 12 21:24:06 UTC 2017 (1)
Looking for host 172.16.1.62 and service ntp
host found : 172.16.1.62
transmit(172.16.1.62)
receive(172.16.1.62)
transmit(172.16.1.62)
receive(172.16.1.62)
transmit(172.16.1.62)
receive(172.16.1.62)
transmit(172.16.1.62)
receive(172.16.1.62)
server 172.16.1.62, port 123
stratum 3, precision -24, leap 00, trust 000
refid [172.16.1.62], delay 0.02592, dispersion 0.00142
transmitted 4, in filter 4
reference time: ddb7c566.e8e2acda Thu, Nov 16 2017 16:05:58.909
originate timestamp: ddb7c665.aa402c9b Thu, Nov 16 2017 16:10:13.665
transmit timestamp: ddb7c665.abf2c8a8 Thu, Nov 16 2017 16:10:13.671
filter delay: 0.02592 0.02596 0.02597 0.02599 0.00000 0.00000 0.00000 0.00000
filter offset: -0.00994 -0.00890 -0.00785 -0.006860.000000 0.000000 0.000000 0.000000
delay 0.02592, dispersion 0.00142
offset -0.00994216 Nov 16:10:13 ntpdate[2058]: adjust time server 172.16.1.62 offset -0.009942 sec step和adjust的区别 [rootCobbler ~]# date -s 20080101
Tue Jan 1 00:00:00 CST 2008
[rootCobbler ~]# ntpdate 172.16.1.62
16 Nov 16:21:26 ntpdate[2085]: step time server 172.16.1.62 offset 311703675.400154 sec 说明 adjust和stepadjust同步时间的时候小于一秒step同步时间的时候大于一秒 CentOS7自带软件chrony 配置文件 vim /etc/chrony.conf
内容和ntp是一样的知识顺序颠倒了
systemctl status chronyd 查看状态
注意chrony 不能和ntp同时存在 只有centos7上有chrony 转载于:https://www.cnblogs.com/lyq863987322/p/8250079.html