centos 7 时间与网络同步 - 谭先生的博客 - CSDN博客


centos 7 时间与网络同步

2018年05月10日 10:03:07 Mrs_谭先生 阅读数:3370

1.安装ntpdate工具

sudo yum -y install ntp ntpdate
  • 1

2.设置系统时间与网络时间同步

sudo ntpdate cn.pool.ntp.org
  • 1

3.将系统时间写入硬件时间

 sudo hwclock --systohc
  • 1

4.查看系统时间

  1. 1
    timedatectl
  2. 2
    #得到
  3. 3
    Local time: 四 2017-09-21 13:54:09 CST
  4. 4
    Universal time: 四 2017-09-21 05:54:09 UTC
  5. 5
    RTC time: 四 2017-09-21 13:54:09
  6. 6
    Time zone: Asia/Shanghai (CST, +0800)
  7. 7
    NTP enabled: no
  8. 8
    NTP synchronized: no
  9. 9
    RTC in local TZ: yes
  10. 10
    DST active: n/a

如果没有执行步骤3,则Local time与RTC time显示的值可能不一样

文章转载至:centos7 设置系统时间与网络同步



comments powered by Disqus