随笔-内网ntps服务器搭建
1、server端修改配置文件
[root@localhost ~]# vim /etc/ntp.conf
# 允许内网的其他机器同步:
restrict 192.168.78.0 mask 255.255.255.0 nomodify notrap
# 外部时间服务器不可用时,以本地时间作为时间服务
server 127.127.1.0
fudge 127.127.1.0 stratum 5
测试:client端:ntpdate -u 192.168.99.85
2、client端使用ntpd,仍编辑/etc/ntp.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# server 0.centos.pool.ntp.org iburst
# server 1.centos.pool.ntp.org iburst
# server 2.centos.pool.ntp.org iburst
# server 3.centos.pool.ntp.org iburst
server 192.168.99.85
# 允许上层时间服务器主动修改本机时间
restrict 192.168.99.85 nomodify notrap noquery
3、重启ntpd
# 查看服务器是否添加成功:
ntpq -p
# 手动同步时间:
ntpdate -u 192.168.99.85
本文来自博客园,作者:LiYanbin,转载请注明原文链接:https://www.cnblogs.com/stellar-liyanbin/p/18637784
分类:
开发-常用记录
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统