设置系统时间为中国时区并启用NTP同步

1
2
3
4
5
6
7
8
9
10
11
12
# 安装ntp服务
yum install ntp
# 开机启动服务
systemctl enable ntpd
# 启动服务
systemctl start ntpd
# 更改时区
timedatectl set-timezone Asia/Shanghai
# 启用ntp同步
timedatectl set-ntp yes
# 同步时间
ntpq -p