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

centos 7.0 NTP服务搭建

时间:2016-10-22 14:58:20      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:monitor   5.0   同步   允许   时间   org   res   关闭   哪些   

 

NTP服务时间同步

关闭防火墙和selinux或开启防火墙所有服务

[root@server ~]# firewall-cmd --set-default-zone=trusted 

NTP服务

[root@server ~]# yum –y install ntp

[root@server ~]# cat /etc/ntp.conf                    //修改配置文件                             //定义本机与自己同步时间

restrict 176.20.32.0 mask 255.255.255.0 nomodify    //允许哪些主机同步时间

#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 iburst    //定义本机与自己同步时间

fudge 127.127.1.0 stratum 3

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

disable monitor

客户端测试NTP服务

[root@client ~]# ntpdate 172.25.0.254

14 Jul 02:14:02 ntpdate[6052]: adjust time server 172.25.0.254 offset 0.031270 sec   //表试成功

centos 7.0 NTP服务搭建

标签:monitor   5.0   同步   允许   时间   org   res   关闭   哪些   

原文地址:http://www.cnblogs.com/liusl/p/5987523.html

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