配置时间服务器
配置时间
在CentOS6.5上面安装配置NTPSERVER
使用yum源安装NTP:
yum-yinstallntp
配置时间源
vi/etc/ntp.conf
server210.72.145.44
serverntp.api.bz
server2.centos.pool.ntp.org
配置对客户端(172.16.0.0/24的网段机器)提供NTP服务
#vi/etc/ntp.conf
restrict172.16.0.0mask255.255.255.0nomodifynotrap
配置NTPServer的层数提供本地服务
server127.127.1.0#localclock
fudge127.127.1.0stratum2
设置开机时自动运行时间服务
chkconfigntpdon
启动或停止时间服务
#servicentpdstart
#servicentpdstop
#servicentpdrestart
验证ntp服务已经运行
pgrepntpd
更新本服务器的时间
ntpdate-u210.72.145.44
关闭iptables和selinux
#serviceiptablesstop
#setenforce0
配置iptable规则允许客户端访问本机NTPSever
vi/etc/sysconfig/iptables
增加一行(NTPServer使用UDP123端口)
-AINPUT-mstate--stateNEW-mudp-pudp--dport123-jACCEPT
重启iptables
serviceiptablesrestart
Tags:配置时间,配置时间服务器
版权声明:本站文章来源标注为YINGSOO的内容版权均为本站所有,欢迎引用、转载,请保持原文完整并注明来源及原文链接。禁止复制或仿造本网站,禁止在非www.yingsoo.com所属的服务器上建立镜像,否则将依法追究法律责任。本站部分内容来源于网友推荐、互联网收集整理而来,仅供学习参考,不代表本站立场,如有内容涉嫌侵权,请联系alex-e#qq.com处理。