32.12.用 NTP 进行时钟同步
32.12.1. NTP 配置
32.12.1.1. /etc/ntp.conf 文件
# 禁止 ntpq 控制/查询访问。仅允许根据此文件中的 pool 和 server 语句添加对等方。
restrict default limited kod nomodify notrap noquery nopeer
restrict source limited kod nomodify notrap noquery
# 允许来自本地主机的查询和控制访问。
restrict 127.0.0.1
restrict ::1
# 添加特定的服务器。
server ntplocal.example.com iburst
# 添加 FreeBSD 池服务器,直到有 3 到 6 个有效的服务器。
tos minclock 3 maxclock 6
pool 0.freebsd.pool.ntp.org iburst
# 使用本地的闰秒文件。
leapfile "/var/db/ntpd.leap-seconds.list"32.12.1.2. /etc/rc.conf 中的 NTP 条目
32.12.1.3. ntpd 和非特权用户 ntpd
ntpd32.12.2. 使用 PPP 连接与 NTP
最后更新于