Linux下搭建ntp时间同步服务器
2024-09-13 05:22:50
1、ntpd软件安装(略过)
2、修改ntp.conf配置文件
vi /etc/ntp.conf
第一种配置:允许任何IP的客户机都可以进行时间同步
将“restrict default kod nomodify notrap nopeer noquery”这行修改成:
restrict default nomodify
第二种配置:只允许192.168.18.***网段的客户机进行时间同步
在restrict default nomodify notrap noquery(表示默认拒绝所有IP的时间同步)之后增加一行:
restrict 192.168.18.0 mask 255.255.255.0 nomodify
配置文件示例:/etc/ntp.conf
3、以守护进程启动ntpd
/usr/local/ntp/bin/ntpd -c /etc/ntp.conf -p /tmp/ntpd.pid service ntpd start
4、ntpd启动后,客户机要等几分钟再与其进行时间同步,否则会提示“no server suitable for synchronization found”错误。
restrict default nomodify server ntp.api.bz server .pool.ntp.org server .pool.ntp.org server .pool.ntp.org driftfile /var/lib/ntp/drift # Key file containing the keys and key identifiers used when operating # with symmetric key cryptography. keys /etc/ntp/keys # Specify the key identifiers which are trusted. #trustedkey # Specify the key identifier to use with the ntpdc utility. #requestkey # Specify the key identifier to use with the ntpq utility.
最新文章
- java final 关键字
- 解决程序出现“terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)”的问题
- angularjs 手动加载
- iOS开发——UI基础-提示框
- Configuring a Windows Azure Project
- Entity Framework做IN查询
- (转)Linux进程间通信
- ASP.NET Web – 状态管理
- C#_MVC3之使用Authorize简单的验证登录(一)
- bzoj 2818: Gcd 歐拉函數
- Linux高性能server规划——多线程编程(在)
- string字符串转C风格字符串 进而转换为数字
- Django实现用户注册登录
- selenium系列------元素定位套路
- 列表(List) 的增删改查及其他方法 和元组(tuple)的查
- Spark:性能调优
- 复习string和数组
- echarts-环形图处理图列中的点击,使百分比的数据列不发生变化,默认追加其他选项
- office 2016 install(office2016组件自定义安装激活程序) v5.9.3中文绿色版
- python值解析excel