1、安装ntpdate,执行以下命令
# 安装utpdate命令 yum install ntpdate -y
![](https://img2020.cnblogs.com/blog/744638/202012/744638-20201226192553031-1866430256.png)
2、手工同步网络时间,执行以下命令,将从time.nist.gov同步时间
ntpdate 0.asia.pool.ntp.org
若上面的时间服务器不可用,也可以选择以下服务器同步时间
time.nist.gov time.nuri.net 0.asia.pool.ntp.org 1.asia.pool.ntp.org 2.asia.pool.ntp.org 3.asia.pool.ntp.org
vi /etc/crontab * */1 * * * ntpdate 0.asia.pool.ntp.org # 每隔1小时同步一次时间。
![](https://img2020.cnblogs.com/blog/744638/202012/744638-20201226192518758-1132882499.png)
![](https://img2020.cnblogs.com/blog/744638/202012/744638-20201226192442437-954253005.png)
date
5、系统时间同步到硬件,防止系统重启后时间呗还原
hwclock --systohc
![](https://img2020.cnblogs.com/blog/744638/202012/744638-20201226192358439-903757688.png)