无法在 CentOS 7.3(1611) 上永久更改日期时间

无法在 CentOS 7.3(1611) 上永久更改日期时间

我在云服务器上有CentOS7(1611)(中国腾讯提供),并尝试通过 , 更改date时间timedatectl。时间更改了,但是时间很快就自动更改为“实际当前时间”(有时更改时间后仅约1分钟就重置)。我关闭了 NTP 和 chronyd。顺便说一句,只有我可以访问服务器,其他人不能更改时间。

如何检查这个问题呢?或者有什么办法可以永久改变时间吗?

[user@VM_227_172_centos bin]$ systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
[user@VM_227_172_centos bin]$ timedatectl 
      Local time: Thu 2017-08-03 19:33:12 CST
  Universal time: Thu 2017-08-03 11:33:12 UTC
        RTC time: Thu 2017-08-03 13:31:19
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
[user@VM_227_172_centos bin]$ timedatectl set-time "23:23:21"
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-time ===
Authentication is required to set the system time.
Authenticating as: root
Password: 
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to set time: Access denied
[user@VM_227_172_centos bin]$ timedatectl set-time "23:23:21"
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-time ===
Authentication is required to set the system time.
Authenticating as: root
Password: 
==== AUTHENTICATION COMPLETE ===
[user@VM_227_172_centos bin]$ timedatectl 
      Local time: Thu 2017-08-03 23:23:25 CST
  Universal time: Thu 2017-08-03 15:23:25 UTC
        RTC time: Thu 2017-08-03 15:23:26
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
[user@VM_227_172_centos bin]$ timedatectl 
      Local time: Thu 2017-08-03 23:26:31 CST
  Universal time: Thu 2017-08-03 15:26:31 UTC
        RTC time: Thu 2017-08-03 15:26:32
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
[user@VM_227_172_centos bin]$ timedatectl 
      Local time: Thu 2017-08-03 19:52:53 CST
  Universal time: Thu 2017-08-03 11:52:53 UTC
        RTC time: Thu 2017-08-03 15:42:18
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

如果有任何信息遗漏,请告诉我。

答案1

我使用以下命令更改 CentOS 7 vicidial 服务器的时区:

# rm /etc/localtime
rm: remove regular file `/etc/localtime'? y
# ln -s /usr/share/zoneinfo/Europe/Rome localtime
# date 

你会看到它已经改变了。

相关内容