centos6.5安装配置时间服务器

centos6.5 安装时间服务器
---------服务端口UDP123
1、查看系统是否已经安装ntp服务组件:
rpm -qa | grep "ntp"    
2、 yum安装
yum -y install ntp
3、配置NTP服务
[root@localhost ~]# egrep -v "^$|#" /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1                                  #<==允许本机的一切操作
restrict -6 ::1                                    #同步时间.但是拒绝让他们修改服务器上的时间
restrict 172.16.1.0 mask 255.255.255.0 nomodify    #允许允许局域网内所有client连接到这台服务器
server ntp1.aliyun.com
server ntp2.aliyun.com
server ntp3.aliyun.com
server ntp4.aliyun.com
server ntp5.aliyun.com
server ntp6.aliyun.com                             #<==同步公网的时间
server 127.127.1.0                                 #<==如果无法连接公网,则使用自己本身的时间作为标准时间。
fudge 127.127.1.0 stratum 10                       #<==设置stratum级别
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys

4、添加开机启动
[root@localhost ~]# chkconfig ntpd on
============
5、让硬件同步时间
[root@localhost ~]# cat /etc/sysconfig/ntpd
# Drop root to id 'ntp:ntp' by default.
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
SYNC_HWCLOCK="yes"
6、开放UDP123端口
iptables -I INPUT -p udp --dport 123 -j ACCEPT

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值