centos7设置时间和上海时区并进行同步

1、设置时区(同步时间前先设置)

timedatectl set-timezone Asia/Shanghai

2、安装组件

yum -y install ntp
systemctl enable ntpd
systemctl start ntpd

3、同步时间

ntpdate -u cn.pool.ntp.org

4、查看时间

date
posted @ 2021-01-07 09:17  带着泥土  阅读(837)  评论(0)    收藏  举报