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.

最新文章

  1. java final 关键字
  2. 解决程序出现“terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)”的问题
  3. angularjs 手动加载
  4. iOS开发——UI基础-提示框
  5. Configuring a Windows Azure Project
  6. Entity Framework做IN查询
  7. (转)Linux进程间通信
  8. ASP.NET Web – 状态管理
  9. C#_MVC3之使用Authorize简单的验证登录(一)
  10. bzoj 2818: Gcd 歐拉函數
  11. Linux高性能server规划——多线程编程(在)
  12. string字符串转C风格字符串 进而转换为数字
  13. Django实现用户注册登录
  14. selenium系列------元素定位套路
  15. 列表(List) 的增删改查及其他方法 和元组(tuple)的查
  16. Spark:性能调优
  17. 复习string和数组
  18. echarts-环形图处理图列中的点击,使百分比的数据列不发生变化,默认追加其他选项
  19. office 2016 install(office2016组件自定义安装激活程序) v5.9.3中文绿色版
  20. python值解析excel

热门文章

  1. 连接pgsql
  2. Mediawiki随笔
  3. magento里get与post传值如何接收
  4. C#异常性能影响
  5. python 3.5构建WINDOWS推送服务
  6. jqery总结
  7. 搭建gitbook环境
  8. python修炼4
  9. Spring.net 学习IOC------准备
  10. jfianl返回自定义的404页面