CentOS7 下部署NTP服务供内网客户机使用
1. 安装NTP服务
yum -y install ntp
2、安装ntp服务
yum -y install ntp
3、修改 ntp配置
vi /etc/ntp.conf
# 记录和上级时间服务器的时间差异,默认配置,保留
driftfile /var/lib/ntp/drift
#表示nomodify客户端可以同步时间
restrict default nomodify
# 允许本机的一切操作,默认策略,保留
restrict 127.0.0.1
restrict ::1
# 阿里云NTP服务可修改本NTP服务时间
restrict ntp.aliyun.com
# 添加阿里云时间源
server ntp.aliyun.com
4、启动NTP服务
启动:systemctl start ntpd
设置开机自启:systemctl enable ntpd
细节参考: https://www.cnblogs.com/harrymore/p/9566229.html
-----------------------------------------------------------------------------
AIX客户端同步NTP时间:
1、配置/etc/ntp.conf文件,添加NTP服务器地址信息(server 192.168.1.20)
broadcastclient
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
server 192.168.1.20
启动 xntpd
方法1:
startsrc -s xntpd
方法2:
smit xntpd
检查服务状态
lssrc -ls xntpd
4、使用ntpdate手动与NTP服务器同步
ntpdate -d 192.168.1.20