ntp对时

在 CentOS 中,可以使用 NTP(Network Time Protocol)协议来同步时间。以下是设置步骤:

  1. 安装 NTP 软件包:
yum -y install ntp
  1. 编辑 /etc/ntp.conf 文件,添加 NTP 服务器地址。例如,使用中国大陆的 NTP 服务器:
 server ntp1.aliyun.com prefer #添加ntp服务器地址为首要地址
 server ntp2.aliyun.com  #添加ntp服务器地址为备用地址
 server ntp3.aliyun.com  #添加ntp服务器地址为备用地址
  1. 重启 NTP 服务:
systemctl restart ntpd
service ntpd restart

#开机自启
chkconfig ntpd on
  1. 同步:
ntpq -p

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片快捷回复

    暂无评论内容