允许与我们的时间源同步时间,但是不允许源查询或修改这个系统上的服务。

# Permit time synchronization with our time source, but do not

# permit the source to query or modify the service on this system.

restrict default nomodify notrap noquery

restrict -6 default kod nomodify notrap nopeer noquery

环回网卡允许所有访问。这可能收紧,但这样做会有些影响管理功能。

# Permit all access over the loopback interface.  This could

# be tightened as well, but to do so would effect some of

# the administrative functions.

restrict 127.0.0.1

restrict -6 ::1

允许系统在这个网络同步时间服务。不允许修改这些系统配置的服务。此外,不能使用那些系统作为对等体。

# -- CLIENT NETWORK -------

# Permit systems on this network to synchronize with this

# time service.  Do not permit those systems to modify the

# configuration of this service.  Also, do not use those

# systems as peers for synchronization.

# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap禁止ntpdc修改服务器状态,允许内网其他机器同步时间

从pool.ntp.org项目使用公共时间服务器。

# --- OUR TIMESERVERS -----

# 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

server 2.centos.pool.ntp.org

利用server 设定上层NTP服务器,格式如下:

server [IP or hostname] [prefer]

perfer:表示优先级最高

burst :当一个运程NTP服务器可用时,向它发送一系列的并发包进行检测。

iburst :当一个运程NTP服务器不可用时,向它发送一系列的并发包进行检测。

注:默认情况小15分钟后才会与上层NTP服务器进行时间校对。.

# --- NTP MULTICASTCLIENT ---多播

#multicastclient

# listen on default 224.0.1.1  # multicast server 其中IP为NTP固定组播地址

# restrict 224.0.1.1 mask 255.255.255.255 nomodify notrap

# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

#broadcast 192.168.1.255 autokey        # broadcast server

#broadcastclient                        # broadcast client

#broadcast 224.0.1.1 autokey            # multicast server 其中IP为NTP固定组播地址

#multicastclient 224.0.1.1              # multicast client

#manycastserver 239.255.254.254         # manycast server

#manycastclient 239.255.254.254 autokey # manycast client

没有驯服的本地时钟。这是一个假的驱动程序用于备份,在没有外部来源的同步时间是可用的。默认层通常是3,但在这种情况下,我们选择使用层0。由于服务器没有选择关键字,这个驱动程序从未用于同步时间,除非没有其他同步源。如果本地主机控制的一些外部来源,如外部振荡器或另一个协议,选择关键字会导致本地主机无视所有其他同步源,除非内核修改正在使用和声明一个同步的条件。

# --- GENERAL CONFIGURATION ---

# Undisciplined Local Clock. This is a fake driver intended for backup

# and when no outside source of synchronized time is available. The

# default stratum is usually 3, but in this case we elect to use stratum

# 0. Since the server line does not have the prefer keyword, this driver

# is never used for synchronization, unless no other other

# synchronization source is available. In case the local host is

# controlled by some external source, such as an external oscillator or

# another protocol, the prefer keyword would cause the local host to

# disregard all other synchronization sources, unless the kernel

# modifications are in use and declare an unsynchronized condition.

#

#server 127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

#skate add

server 192.168.2.29 prefer

#skate add

漂移文件。把这个守护进程可以写在目录中。

不允许符号链接,因为守护进程更新文件,在相同的目录中,然后通过创建一个临时的重命名()的rename()'ing文件。

# Drift file.  Put this in a directory which the daemon can write to.

# No symbolic links allowed, either, since the daemon updates the file

# by creating a temporary in the same directory and then rename()'ing

# it to the file.

#

driftfile /var/lib/ntp/drift

broadcastdelay  0.008

#

以driftfile记录BIOS与上层Time Server时间差异,关于文件名必须要知道以下几点:driftfile后面接的文件需要使用完整路径的文件名;该文件不能是链接文件;该文件需要设置成ntpd这个守护进程可以写入的权限;该文件所记录的数值单位为百万分之一秒(ppm)

密钥文件。如果你想骗取您在运行时的服务器,使用一个键文件(600模式)和定义的关键数字

用于发出请求。

# Keys file.  If you want to diddle your server at run time, make a

# keys file (mode 600 for sure) and define the key number to be

# used for making requests.

#

在这里请不要使用默认值。选择你自己的,还是远程的

系统可以调整时钟。还请注意, ntpd启动a标志,禁用认证,将会被删除。

# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote

# systems might be able to reset your clock at will. Note also that

# ntpd is started with a -A flag, disabling authentication, that

# will have to be removed as well.

#

keys            /etc/ntp/keys

对于ntp.conf的理解的更多相关文章

  1. 配置NTP服务ntpd/ntp.conf(搭建Hadoop集群可参考)

    本文拟定是在一个局域网内(比如一个Hadoop集群)设定一台NTP服务器作为整个网络的标准时间参考,使用网络(集群)内的所有机器保持时间一致!以下是详细的操作步骤: 1. 修改选定的服务器的本地时间 ...

  2. /etc/ntp.conf

    摘录一: System:ubuntu10.04 配置文件路径:/etc/ntp.conf   配置格式:关键字(如server)    参数(如prefer) 以换行为结束,所以一个配置不能占多行. ...

  3. bind named.conf 的理解

    [root@46 /]#yum -y install bind bind-chroot bind-libs bind-utils caching-nameserver目录说明/var/named/ch ...

  4. ntp.conf:很少有人提及的事

    [你可以到ntp.org下个ntp server的源代码,里面有HTML格式的文档,内容很全面.] [REF: http://doc.ntp.org/] Comprehensive List of C ...

  5. gxx -L和/etc/ld.so.conf的理解

    编程之路刚刚开始,错误难免,希望大家能够指出. 今天编了个动态库,然后自己测试了一下. 忘记设置程序运行时系统搜索库的路径发生错误: 忘记设置程序编译的时候 -L 指定路径报的错误: -L : 告诉程 ...

  6. ntp时间同步服务器配置

    ntp同步的两种方式:1.使用ntpdate命令直接同步 2.使用NTPD服务平滑同步直接同步方式的缺陷:会导致已经做的定时任务再做一遍.平滑同步每次同步时间的偏移量不会太陡,根据偏移量,均方差等值每 ...

  7. The Reflection And Amplification Attacks && NTP Reply Flood Attack Based On NTP

    目录 . NTP简介 . NTP协议格式 . NTP Reflect反射漏洞和NTP协议的关系 . 漏洞触发的前提和攻击需要的步骤 . 针对漏洞的攻防思考 1. NTP简介 Network Time ...

  8. linux服务之ntp与chrony

    centos7.2变成了chrony RHEL从7.0开始改用chrony同步时间,原ntp同步方式也可以使用,但要安装ntp服务. [root@1st-kvm plymouth]# rpm -qa| ...

  9. Linux下的NTP

    一.电脑时间的误差众 所周知,电脑主机的时间是根据电脑晶振以固定频率振荡,从而产生的.由于晶振的不同,会导致电脑时间与UTC时间 (全球标准时间:全球标准时间指的是由世界时间标准设定的时间.原先也被称 ...

随机推荐

  1. [AT2364] [agc012_d] Colorful Balls

    题目链接 AtCoder:https://agc012.contest.atcoder.jp/tasks/agc012_d 洛谷:https://www.luogu.org/problemnew/sh ...

  2. [HAOI2017]八纵八横 线性基

    题面 题面 题解 观察到题目中的 "内陆经济环" 不好处理,因此我们把它拆成 "内陆经济链". 对于1号节点,我们创建一个它的复制节点n + 1号节点,这个节点 ...

  3. 9个基于Java的搜索引擎

    1.Java 全文搜索引擎框架 Lucene 毫无疑问,Lucene是目前最受欢迎的Java全文搜索框架,准确地说,它是一个全文检索引擎的架构,提供了完整的查询引擎和索引引擎,部分文本分析引擎.Luc ...

  4. unity3d模型不接受光照

    9楼 发表于 2015-4-21 16:34 | 只看该作者 sailo 发表于 2015-4-14 11:15 你好.遇到同样问题,请问要什么解决 1.你可以选择你不受光线照射的模型,模型属性lay ...

  5. 《Linux内核设计与实现》读书笔记——第一二章

    <Linux内核设计与实现>读书笔记——第一二章 第一章 Linux内核简介 1.1 Unix的历史 简洁:仅提供系统调用并有一个非常明确的设计目的. 抽象:Unix中绝大部分东西都被当做 ...

  6. HikariPool-1 - Connection is not available, request timed out after XXXXms.

    hikaripool-0-连接不可用,请求在30000ms之后超时.意思是池等待30000ms的免费连接,但是您的应用程序没有返回任何连接. 原因一:连接泄漏(在从池中借用之后连接没有关闭).解决方法 ...

  7. [学习笔记]搜索——模拟与dp的结合

    搜索: 一种基础的算法. 考察常见于NOIP 但是高级的搜索算法可能还会在省选出现. 50%以上的暴力都可以用搜索直接枚举来写. 但是,当数据规模不是很大的时候,搜索也可能成为正解. (比如剪枝PK状 ...

  8. C++类成员空间分配和虚函数表

    最近在自学python,看到继承和类,就顺便复习了C++的类和继承等方面的知识. 先看Base基类 class Base { private: virtual void display() { cou ...

  9. 题解【bzoj3529 [SDOI2014]数表】

    Description \(T\) 组询问,定义 \(F(n)=\sum\limits_{d|n}d\).每次给出 \(n,m,a\) 求 \[\sum\limits_{i=1,j=1,F(\gcd( ...

  10. C#微信开发系列笔记(1)入门指引

    (1)基本配置 这节具体的详情请看官方文档,我只提示一点,非常重要,非常容易忽视的,我是吃了苦头的... 在“修改配置”这个地方,如下图: 在URL处,一定要填写http://www.xxx.com/ ...