centos同步时间(要求联网)

yum install ntp #安装ntp服务
systemctl enable ntpd #开机启动服务
systemctl start ntpd #启动服务
timedatectl set-timezone Asia/Shanghai #更改时区
timedatectl set-ntp yes #启用ntp同步
ntpq -p  #同步时间
posted @ 2018-12-14 10:11  xuejianbest  阅读(262)  评论(0编辑  收藏  举报