linux设置时间同步

linux设置时间同步

1、安装 ntpdate:

centos: yum install -y ntpdate

ubuntu: apt install -y ntpdate

2、创建软连接把上海时间包连过去系统时间包

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

3、开始同步

ntpdate 0.asia.pool.ntp.org

4、防止系统重启后时间被还原

hwclock –systohc

chenj

评论已关闭。