ntp服务安装配置

1.rpm -ivh libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm 
ntp 安装依赖这个软件包
2.rpm -ivh ntp-4.2.6p5-10.el6.centos.2.x86_64.rpm
安装ntp-server


3.配置/etc/ntp.conf
拒绝所有的ipv4用户
restrict default kod nomodify notrap nopeer noquery
解决所有的ipv6用户
restrict -6 default kod nomodify notrap nopeer noquery 


restrict 192.168.1.2 允许ip进入
restrict 192.168.2.0 mask 255.255.255.0 允许网段进入


参数说明
ignore 拒绝所有的ntp连接
nomodfiy 客户端不能使用ntpc和ntpq这两个程序修改时间参数,客户端可以校时
notrap 不提供trap这个远程事件登录(remote event logging)的功能
noquery 客户端不能使用ntpc和ntpq等命令查询服务器时间,等于不提供网络校时
notrust 拒绝没有认证的客户端




server 2.rhel.pool.ntp.org ======上层同步的服务器


如果在上层时间服务器不能提供服务的时候,则使用这里进行本机的同步
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 




客户端安装
rpm -ivh ntpdate-4.2.6p5-10.el6.centos.2.x86_64.rpm


ntpdate serveriP  与server时间保持同步
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值