gpt4 book ai didi

linux - NTPD : how to protect the connection of client with a Symmetric key?

转载 作者:太空宇宙 更新时间:2023-11-04 03:52:52 24 4
gpt4 key购买 nike

我在同步时间时尝试使用对称 key ,因为它是我公司的产品,所以我只能使用命令“ntpd”,所以没有像“ntpq”这样的命令来获取更多信息。

这是我所做的:
1)无需验证 key 即可同步时间,它可以工作
2) 然后ntp-gen在服务器端生成MD5 key 文件

   /tmp/ntp.keys
2 MD5 N6\VRj&\t96tl]Xb@%$^ # MD5 key
3 MD5 M_4ga}||b_WM@te[\S33 # MD5 key

3) 选择一行并添加到客户端的 ntp.keys

 /tmp/ntp.keys    
2 MD5 N6\VRj&\t96tl]Xb@%$^ # MD5 key

4) 服务器端的ntp.conf

broadcast 10.66.208.26 key 2    

keys /tmp/ntp.keys
trustedkey 2
requestkey 2
controlkey 2

5) 客户端的ntp.conf

server 10.66.208.122

6)同步时间命令:

ntpd -a -k /tmp/ntp.keys -g -q -d -c /tmp/ntp.conf

由于操作系统的概念,我们仅使用 ** -a ** 来主动进行身份验证检查,而不使用 key 号。

7) 然后输出:
问题出在最后:找不到服务器。我无法理解,因为有“发送”和“接收”

ntpd 4.2.6p3@1.2290 Thu Sep  4 21:36:24 UTC 2014 (2)    
5 Sep 16:10:42 ntpd[4958]: proto: precision = 3.875 usec
event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled
Finished Parsing!!
5 Sep 16:10:42 ntpd[4958]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
5 Sep 16:10:42 ntpd[4958]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
5 Sep 16:10:42 ntpd[4958]: Listen and drop on 1 v6wildcard :: UDP 123
5 Sep 16:10:42 ntpd[4958]: Listen normally on 2 lo 127.0.0.1 UDP 123
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00003000 flags 00000001
5 Sep 16:10:42 ntpd[4958]: Listen normally on 3 wan2 10.66.208.26 UDP 123
restrict: op 1 addr 10.66.208.26 mask 255.255.255.255 mflags 00003000 flags 0000001
5 Sep 16:10:42 ntpd[4958]: Listen normally on 4 iloc 192.168.0.1 UDP 123
restrict: op 1 addr 192.168.0.1 mask 255.255.255.255 mflags 00003000 flags 00000001
5 Sep 16:10:42 ntpd[4958]: Listen normally on 5 lo ::1 UDP 123
restrict: op 1 addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
5 Sep 16:10:42 ntpd[4958]: Listen normally on 6 wan2 fe80::7e66:9dff:fe12:3fd UDP 123
restrict: op 1 addr fe80::7e66:9dff:fe12:3fd mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
5 Sep 16:10:42 ntpd[4958]: Listen normally on 7 iloc fe80::7e66:9dff:fe12:3ff UDP 123
restrict: op 1 addr fe80::7e66:9dff:fe12:3ff mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
5 Sep 16:10:42 ntpd[4958]: Listen normally on 8 plc0 fe80::1010:ff:fe00:0 UDP 123
restrict: op 1 addr fe80::1010:ff:fe00:0 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
5 Sep 16:10:42 ntpd[4958]: peers refreshed
5 Sep 16:10:42 ntpd[4958]: Listening on routing socket on fd #25 for interface updates
peer_clear: at 0 next 1 associd 53920 refid INIT
event at 0 10.66.208.122 8011 81 mobilize assoc 53920
newpeer: 10.66.208.26->10.66.208.122 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
event at 0 0.0.0.0 c016 06 restart
event at 0 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
event at 0 0.0.0.0 c011 01 freq_not_set
transmit: at 1 10.66.208.26->10.66.208.122 mode 3 len 48
receive: at 13 10.66.208.26<-10.66.208.122 mode 4 len 48
packet: flash header 1420
transmit: at 15 10.66.208.26->10.66.208.122 mode 3 len 48
receive: at 15 10.66.208.26<-10.66.208.122 mode 4 len 48
packet: flash header 1420
transmit: at 17 10.66.208.26->10.66.208.122 mode 3 len 48
receive: at 17 10.66.208.26<-10.66.208.122 mode 4 len 48
packet: flash header 1420
transmit: at 19 10.66.208.26->10.66.208.122 mode 3 len 48
receive: at 19 10.66.208.26<-10.66.208.122 mode 4 len 48
packet: flash header 1420
transmit: at 21 10.66.208.26->10.66.208.122 mode 3 len 48
receive: at 21 10.66.208.26<-10.66.208.122 mode 4 len 48
packet: flash header 1420
5 Sep 16:11:05 ntpd[4958]: ntpd: no servers found
ntpd: no servers found

最佳答案

我认为您的 ntp.keys 文件可能已关闭。您需要 M,而不是 MD5 作为 key 类型。

/tmp/ntp.keys
2 M N6\VRj&\t96tl]Xb@%$^ # MD5 key
3 M M_4ga}||b_WM@te[\S33 # MD5 key

查看 ntp.org here .

关于linux - NTPD : how to protect the connection of client with a Symmetric key?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25688508/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com