CentOS 7.2 时间同步与时区设置

1、安装 ntp 服务

shell> yum -y install ntp

2、修改启动参数,允许ntp服务在系统时间误差较大时也能正常工作

shell> vi /etc/sysconfig/ntpd
# 增加 -x 参数
OPTIONS="-g -x"

3、启动 ntp 服务

shell> systemctl start ntpd

4、将 ntp 服务设为自启动

shell> systemctl enable ntpd

5、将系统时区改为上海时间 (亦即CST时区)

shell> ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

查看系统时间

shell> date
2016年 11月 18日 星期五 18:14:17 CST

转载于:https://my.oschina.net/mechanic/blog/790513

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值