![从我的 ntp 服务器获取 monlist 时出现问题](https://linux22.com/image/995562/%E4%BB%8E%E6%88%91%E7%9A%84%20ntp%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%8E%B7%E5%8F%96%20monlist%20%E6%97%B6%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98.png)
伙计们,我需要查看我的 NTP 服务器的 MONLIST,但是当我执行命令时,ntpdc -n -c monlist
我得到了错误***Server reports data not found
,我不明白为什么,因为我认为我的 ntp.conf 文件应该启用 monlist。这是我的 ntp.conf 文件
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
pool 0.ubuntu.pool.ntp.org iburst
pool 1.ubuntu.pool.ntp.org iburst
pool 2.ubuntu.pool.ntp.org iburst
pool 3.ubuntu.pool.ntp.org iburst
# Use Ubuntu's ntp server as a fallback.
#pool ntp.ubuntu.com
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
#restrict -4 default kod notrap nomodify nopeer noquery limited
#restrict -6 default kod notrap nomodify nopeer noquery limited
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1 notrust
restrict 192.168.3.0/24 notrust
restrict 192.168.2.0/24 notrust
resrict ::1 notrust
# Needed for adding pool entries
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.3.3 mask 255.255.255.0 notrust
enable mode7
enalbe monitor
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
disable auth
网络 192.168.2.0/24 和 192.168.3.0/24 是我想要用来控制服务器的私人网络。如能得到任何帮助,我将不胜感激
答案1
可能是“enable”拼写错误(“enalbe monitor”)。
答案2
我其实已经弄清楚了为什么这个方法不管用。因为任何 v4.2.7p26 之后的 ntp 服务器版本(包括 v4.2.7p26)都不再响应 monlist 数据包。
希望这可以帮助。
参考:https://new.blog.cloudflare.com/understanding-and-mitigating-ntp-based-ddos-attacks/