centos7 时间设置

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

 //安装ntp服务

yum install ntp

//开机启动服务

systemctl enable ntpd 

 //启动服务
systemctl start ntpd
//更改时区
timedatectl set-timezone Asia/Shanghai 
//启用ntp同步
timedatectl set-ntp yes 
//同步时间
ntpq -p 
 
 

猜你喜欢

转载自www.cnblogs.com/liuq1991/p/9035100.html