第一步:设置时区
1.1、备份系统时间包
cd /etc
mv localtime localtime.bak
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

第二步:同步时间
1、安装chrony
      sudo yum install -y chrony
2、启动和设置配置文件
      sudo  systemctl start chronyd
      //设置为系统自动启动
      sudo systemctl enable chronyd
3、编辑配置文件
vim /etc/chrony.conf
server ntp.aliyun.com iburst
server cn.ntp.org.cn iburst
4、重新加载配置文件
 systemctl restart chronyd.service
5、开始同步时间
 chronyc  sources -v
6、查看时间
date


 

最后修改于 2022-05-23 10:32:48
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付
上一篇