阻止ntp客户端聆听

我一直在尝试构build和configurationntp客户端和服务器 ,并在客户端的ntp.conf使用这一行:

 restrict default ignore 

不过,我看到我的客户端正在监听本地networking接口。 从系统日志中:

 Listening on interface #0 wildcard, 0.0.0.0#123 Disabled Listening on interface #1 wildcard, ::#123 Disabled Listening on interface #2 vmnet8, fe80::250:56ff:fec0:8#123 Enabled Listening on interface #3 lo, ::1#123 Enabled Listening on interface #4 eth0, fe80::222:68ff:fe10:1529#123 Enabled Listening on interface #5 vmnet1, fe80::250:56ff:fec0:1#123 Enabled Listening on interface #6 lo, 127.0.0.1#123 Enabled Listening on interface #7 eth0, 192.168.111.183#123 Enabled Listening on interface #8 vmnet1, 172.16.139.1#123 Enabled 

0-1被禁用,这是很好的。

使用nmap -sUS -O 127.0.0.1打开的端口列表:

 Starting Nmap 4.53 ( http://insecure.org ) at 2009-08-03 12:25 IDT Interesting ports on localhost (127.0.0.1): Not shown: 3195 closed ports PORT STATE SERVICE 22/tcp open ssh 631/tcp open ipp 902/tcp open iss-realsecure-sensor 5432/tcp open postgres 68/udp open|filtered dhcpc 123/udp open|filtered ntp 5353/udp open|filtered zeroconf Device type: general purpose Running: Linux 2.6.X 

正如你所看到的, ntp正在监听123端口。 为什么?

有任何想法吗?

乌迪

答案似乎是使用的协议types:NTP使用UDP协议,这是无连接的,因此需要一个开放的端口从服务器接收请求的时间。

我想我只需要保持这个端口的开放,因为NTP具有非常好的安全性。

它实际上是在尝试同步吗? 我的'man ntp.conf'的副本表明默认条目被自动添加以防止自我同步问题(这是我假设你担心的;如果不是,你可能想澄清你的问题是什么):

对于每个本地主机的接口地址,具有标志ignore,interface,ntpport的默认限制列表条目在启动时被插入到表中,以防止服务器尝试同步到它自己的时间。 默认条目也总是存在,尽pipe如果它没有被configuration; 没有标志与默认条目相关联(即,除了你自己的NTP服务器以外的所有东西都是不受限制的)。

(ntpd 4.2.4p7)

从我回忆,这是一个服务器行。

在这篇FreeBSD文章中阅读“ 控制对服务器的访问”部分

如果您想拒绝所有机器访问您的NTP服务器,请将[该行添加到服务器]


您可能需要在TLDP-SAG页面上重新检查这些基本NTPconfiguration说明。