我在外部提供商处运行 Linux(Ubuntu 16.04 LTS)虚拟服务器(使用 virtuozzo),但无法在我的 nextcloud 实例中运行双因素身份验证。我认为这与服务器时间落后有关。
如果我有时间
date
我收到了正确的时区,但时间晚了约 3 分钟。
我想通过安装 ntp 来解决这个问题
sudo apt-get install ntp
sudo nano /etc/ntp.conf
我像这样设置了conf文件
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Time Server
server de.pool.ntp.org iburst
# 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
restrict ::1
我重启了服务
sudo systemctl restart ntp.service
但时间仍然不同步,
ntpq -p
我收到此错误消息
ntpq: read: Connection refused
如果我将时间同步到
ntpd -q -g
我明白了
11 Apr 17:07:24 ntpd[4967]: ntpd [email protected] Wed Feb 14 14:56:29 UTC 2018 (1): Starting
11 Apr 17:07:24 ntpd[4967]: Command line: ntpd -q -g
11 Apr 17:07:24 ntpd[4967]: proto: precision = 0.089 usec (-23)
11 Apr 17:07:24 ntpd[4967]: Listen and drop on 0 v6wildcard [::]:123
11 Apr 17:07:24 ntpd[4967]: Listen and drop on 1 v4wildcard 0.0.0.0:123
11 Apr 17:07:24 ntpd[4967]: Listen normally on 2 lo 127.0.0.1:123
11 Apr 17:07:24 ntpd[4967]: Listen normally on 3 venet0:0 <IP ADRESS>
11 Apr 17:07:24 ntpd[4967]: Listen normally on 4 lo [::1]:123
11 Apr 17:07:24 ntpd[4967]: Listen normally on 5 venet0 [2a02:2b80:1:0:5652::625]:123
11 Apr 17:07:24 ntpd[4967]: Listen normally on 6 venet0 [::2]:123
11 Apr 17:07:24 ntpd[4967]: Listening on routing socket on fd #23 for interface updates
11 Apr 17:07:31 ntpd[4967]: step-systime: Operation not permitted
11 Apr 17:07:31 ntpd[4967]: ntpd: time set +170.495454 s ntpd: time set +170.495454s
但时间仍然慢了3分钟
我该怎么做才能同步此虚拟服务器?我向提供商开具了一张票据,但仍未得到答复。