【Debian 8 Jessie】进行时间同步

本文是由以下的文章之一组成的文章。
在Sakura的VPS上以Debian 8 Jessie为基础,创建独立域名的网站的步骤。

前提是使用Sakura的VPS(512方案)和Debian 8 Jessie(Sakura的VPS定制安装)的环境。

安装NTP

sudo aptitude -y install ntp

設定同步時間的NTP伺服器

sudo vi /etc/ntp.conf
#server 0.debian.pool.ntp.org iburst
#server 1.debian.pool.ntp.org iburst
#server 2.debian.pool.ntp.org iburst
#server 3.debian.pool.ntp.org iburst
server ntp1.jst.mfeed.ad.jp
server ntp2.jst.mfeed.ad.jp
server ntp3.jst.mfeed.ad.jp

完成设定后,重新启动ntp服务。

sudo systemctl restart ntp

请使用下面的命令进行操作验证。

sudo ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+ntp1.jst.mfeed. 133.243.236.17   2 u  682 1024  377    0.758    0.431   0.086
*ntp2.jst.mfeed. 133.243.236.17   2 u   83 1024  377    0.778    0.026   0.145
+ntp3.jst.mfeed. 133.243.236.17   2 u  747 1024  377    0.945   -1.850   0.826

将NTP设置为自动启动。

sudo systemctl enable ntp