VMware安装CentOS后时间相差8小时解决方法

1、执行date查看时区设置是否正确,如果是CST就是中国标准时间

2、将/etc/localtime指向上海时间

ln –sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
3、下载ntp(前提是机器能联网)

yum –y install ntp
4、执行对时

ntpdate cn.pool.ntp.org
5、对时后再次执行date查看时间,如果已经是正确的时间则进入下一步

6、将系统时间写入硬件(这步如果不执行重启机器后时间又会出问题)

hwclock -w

Leave a Reply

Your email address will not be published. Required fields are marked *