Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 822 Bytes

2006_12_24_use_ntpd.md

File metadata and controls

23 lines (17 loc) · 822 Bytes

配置你的系统时间(ntpd)

在网络上校对时间,通过ntpd是非常方便的。ntpd(Network Time Protocol daemon)实现了标准的协议,用来调整当前系统的时间,也可以作为参照标准,给其他机器校对时间。

这里仅仅介绍如何校对自己系统的时间。OpenBSD 中设置 ntpd 非常方便。在 /etc/rc.conf.local 中加入下面一句:

ntpd="-s"

则每次启动 OpenBSD,系统时间都会自动校准。

ntpd 的配置文件为 /etc/ntpd.conf,一般只有一句话即可:

servers pool.ntp.org

其中 pool.ntp.org 是一个免费提供 ntp 服务的服务器。

需要更详细的介绍,就 man 一下 ntpd、ntpd.conf 啦。

ps. 如果不想启动 ntpd ,又需要手动校对时间,可以通过命令:

rdate -4n pool.ntp.org