Centos6.*同步系统时间

本文主要记录关于Centos6.*时间同步的操作记录,以备将来有用。

 

1.安装ntpdate服务

  yum -y install ntp ntpupdate

2.修改时区

  vim /etc/sysconfig/clock

  

 

 3.文件生效

  ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

4.时间同步

  ntpdate cn.pool.ntp.org

5.时间写入

  系统时间写入硬件时间

  hwclock --systohc

  强制写入,防止重启失效

  hwclock -w

posted @ 2020-11-27 12:59  李文学  阅读(353)  评论(0编辑  收藏  举报