1. 相关命令收集
#安装工具
apt-get install ntpdate
#查看安装是否成功
ntpdate -v
#使用受时时间同步到本地网络
ntpdate -u ntp.ntsc.ac.cn
ntpdate -u cn.ntp.org.cn
#查看硬件时钟
hwclock --show
#将系统时间同步到硬件时钟中
hwclock --systohc
#从硬件时钟读取时间到系统时间
hwclock --hctosys
#设置硬件时钟
hwclock --set --date="2023-10-23 20:00:00"
2. NTP 服务器地址可供选择,这些服务器通常由权威的时间服务机构运营,提供了稳定和准确的时间同步服务。以下是一些在中国常用的 NTP 服务器地址
1. 国家授时中心 NTP 服务器:
cn.ntp.org.cn
ntp.org.cn
time.windows.com(微软提供的 NTP 服务,在中国有良好的可用性)
2. 中国科学院国家授时中心:
ntp1.ntsc.ac.cn
ntp2.ntsc.ac.cn
ntp3.ntsc.ac.cn
3. 香港大学:
hk.pool.ntp.org
4. 清华大学:
tuna.tsinghua.edu.cn
5. 上海交通大学:
ntp.sjtu.edu.cn