在我的/etc/ntp.conf ,它说
By default, exchange time with everybody, but don't allow configuration. restrict -4 default kod notrap nomodify nopeer noquery restrict -6 default kod notrap nomodify nopeer noquery
我只想从指定的服务器接收时间,以防止这样的DDoS攻击。
如何修改这个文件,以免从同伴那里得到时间?
如果服务器是可公开访问的,则应该在您的configuration中包含以下行:
restrict default kod limited nomodify noquery nopeer notrap
如果您需要远程pipe理function,您可以添加restrict行,然后允许特定的IP访问。 如果不能公开访问,则不必担心“monlist”放大攻击。
如果你不知道你在做什么,你真的不应该运行公共的NTP服务器。 这条线路的pipe理function被阻塞,而且在你所链接的攻击中被利用的pipe理function与和其他系统交换时间无关。 此外,NTP中的“客户”和“服务器”不同。
编辑:
以上只是禁用了所有的pipe理function(这是唯一可以被利用的)。 NTP不会与任何事情同步,除非特意告知NTP(通过server , peer , broadcast或manycastclient指令 – 或S0硬件时钟)。
默认情况下,NTP将服务客户端请求,充当服务器 – 禁用这个添加noserve到上面的restrict语句。 这个特殊的选项允许你允许一些pipe理function,同时禁止客户同步时间。
或者,如果你想NTP不“听”任何东西,你可以添加这一行,而不是:
restrict default ignore
您应该特别列出您要收听的服务器:
server 192.168.1.10
确保广播被注释掉。