不同linux系统间的时间同步

如果可以链接外网的话
ntpdate cn.nep.org.cn

如果是局域网的话
#vi /etc/ntp.conf :修改这个文件
在最后添加这些代码:

#权限控制====
restrict default kod nomodify notrap nopeer noquery 拒绝IPV4用户
restrict -6 default kod nomodify notrap nopeer noquery 拒绝IPV6用户
restrict 210.72.145.44 授权国家授时中心服务器访问本地NTP
restrict 133.100.11.8 授权133.100.11.8访问本地NTP
restrict 127.0.0.1
restrict -6 ::1
restrict 192.168.188.2 mask 255.255.255.0 nomodify 本地网段授权访问
#=源服务器===
server cn.ntp.org.cn prefer 指定上级更新时间服务器,优先使用这个地址
#=差异分析===
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys

然后主服务器开启服务:systemctl start ntpd.service
然后其他电脑上就可以同步时间了:ntpdate 192.168.88.100。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值