摘录于ntp官网:http://support.ntp.org/bin/view/Support/ConfiguringAutokey

6.7. Autokey Configuration for NTP stable releases

This topic provides a step-by-step guide for setting up NTP Autokey Authentication for NTP stable release versions 4.2.6 and later. The material contained in this topic may not be applicable to releases in the ntp-dev series.

Users of NTP-4.2.4, or earlier, should consult Autokey Configuration for NTP 4.2.4

Users of NTP-dev should consult ConfiguringAutokeyDev for errata and notes pertaining to the ntp-dev series of releases.

See the NTP Authentication specification and the Briefing Slides on the Network Time Synchronization Project page for in-depth information about NTP Authentication.

There are three Identity Schemes available in the NTP Reference Implemenation: IFF, GQ, and MV. See the Identity Scheme documentation for detailed information about the Identity Schemes. Although examples of server parameter generation and client parameter installation are provided for all available Identity Schemes, it is not necessary to use all of them.

Enforcement of NTP Authentication (with restrict statements) is beyond the scope of this topic

6.7.2.2.1. Broadcast and Multicast Autokey are configured on the server side. 6.7.3.2.1. Unicast Autokey is configured on the client side

Read 6.7.1. How To Use This Guide before starting

6.7.1. How To Use This Guide

  1. Perform the server set-up before performing the client set-up
  2. Follow each step in this guide

This guide currently only addresses the IFF identity scheme.

6.7.2. Server Set-Up

This section pertains only to systems that will be ntp servers for an NTP Trust Group; see 6.7.3. Client Set-Up for systems that will only be ntp clients. Trusted ntp servers which also operate as clients of other ntp servers may need to 6.7.3.4. Install Group/Client Keys.

6.7.2.1. Create the NTP Keys directory

Create a directory for the NTP Keys (e.g /etc/ntp.)

6.7.2.2. Edit ntp.conf

Add the following lines to ntp.conf:

crypto pw serverpassword
keysdir /etc/ntp

You may need to add the following line to ntp.conf if ntpd dies with a crypto_setup: random seed file not found error:

crypto randfile /dev/urandom

6.7.2.2.1. Broadcast and Multicast Autokey

Append autokey to the broadcast line in ntp.conf for the broadcast/multicast address that you want to authenticate with Autokey:

broadcast my.broadcast.or.multicast.address autokey

The assigned NTP Multicast address is 224.0.1.1, but other valid multicast addresses may be used.

6.7.2.3. Generate Server Parameters

This section covers Server Parameter generation for the IFF Identity Scheme.

The server key and certificate will be generated if they are missing when a set of parameters are generated. The server certificate will be updated when existing parameters are updated or additional parameters are generated.

The -T option for ntp-keygen should only be used by a Trusted Authority (e.g time-server) for an NTP Trust Group.

6.7.2.3.1. IFF Parameters

The IFF parameter generation process produces a server key which should not be distributed to other members of the NTP Trust Group.

Generate the IFF parameters with the following commands:

cd /etc/ntp
ntp-keygen -T -I -p serverpassword

You must export an IFF Group Key for use by the members of the Trust Group. This Group Key is unencrypted and may be handled in the same manner as a PGP/GPG public key.

Export the IFF Group Key with the following commands:

cd /etc/ntp
ntp-keygen -e -p serverpassword

The IFF Group Key will be directed to STDOUT unless you redirect it to a file. The target name of the IFF Group Key file is on one of the first lines of the output.

This exported IFF Group Key will be used in 6.7.3.4.1. IFF Group Keys

IFF Group Keys may be distributed in any convenient manner (e.g. on a web page or even by pasting them across terminal windows).

IFF Group Keys may also be extracted and mailed with the following commands:

cd /etc/ntp
ntp-keygen -e -p serverpassword | mail timelord@client.domain

6.7.2.4. Restart ntpd

Restart ntpd. Watch the output of ntpq -p to make sure that the server is able to start.

6.7.2.5. Server Parameter Update

The server key and certificate are valid only for one year and should be updated periodically (e.g. monthly). This could be scripted with the following command:

cd /etc/ntp
ntp-keygen -T -q `awk '/crypto pw/ { print $3 }' </etc/ntp.conf`

6.7.3. Client Set-Up

This section pertains only to systems that will be clients of an NTP Trust Group.

6.7.3.1. Create the NTP Keys directory

Create a directory for the NTP Keys (e.g. /etc/ntp.)

6.7.3.2. Edit ntp.conf

Add the following lines to ntp.conf:

crypto pw clientpassword
keysdir /etc/ntp

You may need to add the following line to ntp.conf if ntpd dies with a crypto_setup: random seed file not found error:

crypto randfile /dev/urandom

6.7.3.2.1. Unicast Autokey

Append autokey to the server line for the time-server that you want to authenticate with Autokey in a unicast association:

server ntp.i_have_the_key.for autokey

6.7.3.3. Generate Client Parameters

Do not use the -T option for ntp-keygen on systems that are only clients of an NTP Trust Group.

Generate the client key /certificate with the following commands:

cd /etc/ntp
ntp-keygen -H -p clientpassword

6.7.3.4. Install Group/Client Keys

This section covers the installation of Group/Client Keys for all Identity Schemes. You only need to install the Group/Client Keys used by the NTP Trust Group that this client will be joining.

6.7.3.4.1. IFF Group Keys

Obtain the IFF group key, exported in 6.7.2.3.1. IFF Parameters, from your time server operator, copy the key file to the keysdir, and create the standard sym-link:

cd /etc/ntp
ln -s ntpkey_iffpar_server.3301264563 ntpkey_iffpar_server

6.7.3.5. Restart ntpd

Restart ntpd. Watch the output of ntpq -p to make sure that the client is able to start and sync with the server.

6.7.3.6. Client Parameter Update

The client key and certificate are valid only for one year and should be updated periodically (e.g. monthly) with the following command:

cd /etc/ntp
ntp-keygen -q `awk '/crypto pw/ { print $3 }' </etc/ntp.conf`

6.7.4. Monitoring Authentication Status

It is not usually necessary to run ntpd in debug mode to troubleshoot Authentication problems.

Use ntpq -c "rv 0 cert" to view the Autokey certificates held by ntpd.

Use ntpq -c as to the check the authentication status of NTP associations. Authenticated associations display ok in the auth column:

ind assID status  conf reach auth condition  last_event cnt
===========================================================
1 26132 f694 yes yes ok sys.peer reachable 9

For detailed information about an authenticated association use the assID from ntpq -cas in the following command:

ntpq -c"rv assID flags"

An Autokey+IFF association without a verified leapseconds table will show the following flags on the client:

flags=0x83f21

An Autokey+IFF association with a verified leapseconds table will show the following flags on the client:

flags=0x87f21

6.7.4.1. Crypto Association Flags

/*
* The following bits are set by the CRYPTO_ASSOC message from
* the server and are not modified by the client.
*/
#define CRYPTO_FLAG_ENAB 0x0001 /* crypto enable */
#define CRYPTO_FLAG_TAI 0x0002 /* leapseconds table */ #define CRYPTO_FLAG_PRIV 0x0010 /* PC identity scheme */
#define CRYPTO_FLAG_IFF 0x0020 /* IFF identity scheme */
#define CRYPTO_FLAG_GQ 0x0040 /* GQ identity scheme */
#define CRYPTO_FLAG_MV 0x0080 /* MV identity scheme */
#define CRYPTO_FLAG_MASK 0x00f0 /* identity scheme mask */ /*
* The following bits are used by the client during the protocol
* exchange.
*/
#define CRYPTO_FLAG_VALID 0x0100 /* public key verified */
#define CRYPTO_FLAG_VRFY 0x0200 /* identity verified */
#define CRYPTO_FLAG_PROV 0x0400 /* signature verified */
#define CRYPTO_FLAG_AGREE 0x0800 /* cookie verifed */
#define CRYPTO_FLAG_AUTO 0x1000 /* autokey verified */
#define CRYPTO_FLAG_SIGN 0x2000 /* certificate signed */
#define CRYPTO_FLAG_LEAP 0x4000 /* leapseconds table verified */

ntp 配置 autokey 功能【摘录】的更多相关文章

  1. linux服务器应用NTP配置时间同步

    linux服务器应用NTP配置时间同步 • 为什么建议使用ntpd而不是ntpdate? #####原因很简单,ntpd是步进式的逐渐调整时间,而ntpdate是断点更新,比如现在服务器时间是9.18 ...

  2. 华三交换机NTP配置

    clock protocol ntp ntp-service enable ntp-service unicast-server x.x.x.x clock timezone beijing add ...

  3. NTP配置实践

    前言 NTP(Network Time Protocol,网络时间协议)是用来使网络中的各个计算机时间同步的一种协议.不管是平时使用的私人计算机还是在工作中搭建的服务器集群.时间的统一性和准确性是十分 ...

  4. Linux下Apache配置HTTPS功能

    Apache配置HTTPS功能  转 https://www.cnblogs.com/liaojiafa/p/6028816.html 一.yum 安装openssl和openssl-devel,ht ...

  5. 5G RRC——为NAS层提供连接管理,消息传递等服务; 对接入网的底层协议实体提供参数配置的功能; 负责UE移动性管理相关的测量、控制等功能

    from:http://www.cnblogs.com/kkdd-2013/p/3868676.html 1 RRC协议功能 为NAS层提供连接管理,消息传递等服务: 对接入网的底层协议实体提供参数配 ...

  6. Django-中间件-csrf扩展请求伪造拦截中间件-Django Auth模块使用-效仿 django 中间件配置实现功能插拔式效果-09

    目录 昨日补充:将自己写的 login_auth 装饰装在 CBV 上 django 中间件 django 请求生命周期 ***** 默认中间件及其大概方法组成 中间件的执行顺序 自定义中间件探究不同 ...

  7. drf框架安装配置及其功能概述

    0902自我总结 drf框架安装配置及其功能概述 一.安装 pip3 install djangorestframework 二.配置 # 注册drf app NSTALLED_APPS = [ # ...

  8. Nginx 高级配置-https 功能

    Nginx 高级配置-https 功能 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.HTTPS工作过程 1>.SSL/TLS SSL(Secure Socket Lay ...

  9. Nginx 高级配置-压缩功能

    Nginx 高级配置-压缩功能 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Nginx压缩相关参数概述 1>.gzip on | off; Nginx支持对指定类型的文 ...

随机推荐

  1. springboot-vue项目前台1

  2. keepalived nginx 主备配置

    keepalived  nginx 主备配置(多主多备同理) 1.Nginx服务安装 nginx 不区分主备,在两台服务上安装两个即可. 安装参考:https://www.cnblogs.com/zw ...

  3. VCS 常用命令速查

      VCS是编译型Verilog模拟器,它完全支持OVI标准的Verilog HDL语言.PLI和SDF.VCS具有目前行业中最高的模拟性能,其出色的内存管理能力足以支持千万门级的ASIC设计,而其模 ...

  4. INSPIRED启示录 读书笔记 - 第36章 可用性与美感

    两者缺一不可 交互设计和视觉设计完全是两回事 视觉设计可以满足用户的情感需求 良好的用户体验是交互设计师和视觉设计师合作的结果.他们共同配合产品经理定义产品

  5. Linux与Android 多点触摸协议【转】

    本文转载自:http://blog.csdn.net/xubin341719/article/details/7833277 一.Linux与Android 多点触摸协议 为了使用功能强大的多点触控设 ...

  6. Luogu-3878 [TJOI2010]分金币

    这题和在我长郡考试时的一道题思路差不多...考虑折半搜索,预处理左半边选的方案所产生的数量差值\(x\)以及价值差值\(y\),把\(y\)扔到下标为\(x\)的set里面,然后在搜索右半边,每搜出一 ...

  7. BZOJ4311:向量

    题意:要求支持三个操作,加入删除一个向量,询问当前向量与给定向量的最大值. 题解:线段树时间分治,每个区间做一个凸包,查询的时候到对应区间的凸包上三分. (话说我这个可能有点问题,三分那一块R-L&g ...

  8. Apache Phoenix基本操作-1

    本篇我们将介绍phoenix的一些基本操作. 1. 如何使用Phoenix输出Hello World? 1.1 使用sqlline终端命令 sqlline.py SZB-L0023780:2181:/ ...

  9. IOS 发布被拒 PLA 1.2问题 整个过程介绍 01

    公司前端时间发布IOS APP ,但是遇到一些很麻烦的问题,就是一个让人摸不着头脑的问题. 问题: The Seller and Artist names associated with your a ...

  10. codeforces 798C.Mike and gcd problem 解题报告

    题目意思:给出一个n个数的序列:a1,a2,...,an (n的范围[2,100000],ax的范围[1,1e9] ) 现在需要对序列a进行若干变换,来构造一个beautiful的序列: b1,b2, ...