起因:我们使用腾讯的人脸核身时报错:
TencentCloudSDKHttpException [Error]: Signature expired. Please use local time and enable NTP service for time synchronization to avoid a deviation between
Timestampand the server time 1757517238.
这是因为我们服务器的时间与腾讯云的时间不一致。
CentOS 服务器修改时间同步:
1、查看时间同步服务
shell
sudo systemctl status chronyd

如果出现这个说明服务正常运行;
2、查看chronyd
同步状态
shell
sudo chronyc tracking

我们服务器未设置 同步目标服务器。
3、查看chronyd
中关于时间同步目标服务器
的配置项
shell
cat /etc/chrony.conf | grep ^server
我这里什么都没有输出,表示未设置目标服务器
4、设置时间同步目标服务器
shell
# 1、编辑配置文件;
vim /etc/chrony.conf
# 2、在最后一行追加:使用阿里云的时间服务器同步
server ntp.aliyun.com iburst
# 3、保存配置文件的改动
5、重启chronyd
服务
shell
sudo systemctl restart chronyd # 重启
sudo systemctl status chronyd # 查看运行状态
6、再次查看chronyd
同步状态
shell
sudo chronyc tracking

已经指定目标服务器、且时间误差变小了、也开始同步了;
7、最后验证一下时间
shell
date
# 输出: 2025年 09月 10日 星期三 23:54:27 CST