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时间保持同步
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时间保持同步