< 返回

Centos同步时间

2023-07-07 11:19 作者:墨云 阅读量:1185

linux系统的时间同步主要分两种:

下面主要针对centos系统进行说明,其他系统都类似

 

一、同步时区

date -R #查看时区

timedatectl list-timezones #列出所有时区

timedatectl set-timezone Asia/Shanghai #设置系统时区为上海

二、同步时间

安装ntpdate工具

yum -y install ntp ntpdate

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

ntpdate http://cn.pool.ntp.org

3、再重新检查当前时间:

date

联系我们
返回顶部