1、安装ntpdate,执行以下命令

# yum install ntpdate -y

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

3、使用crontab计划任务定时更新网络时间,修改crontab文件,在末尾增加* */1 * * * ntpdate 0.asia.pool.ntp.org,每隔1小时同步一次时间。

# vi /etc/crontab

linux服务器时间同步

4、使用date命令查看当前时间

linux服务器时间同步

5、系统时间同步到硬件,防止系统重启后时间呗还原

# hwclock -w

相关文章:

  • 2021-11-27
  • 2021-08-06
  • 2021-06-23
  • 2021-08-28
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
猜你喜欢
  • 2021-12-22
  • 2022-01-21
  • 2021-05-15
  • 2022-12-23
  • 2021-06-25
  • 2021-08-21
相关资源
相似解决方案