Centos 时间校正

355人浏览 / 0人评论

ntp

# 查看当前时间
date

# 安装ntp
yum install ntp

# 手动校正
ntpdate ntp.ntsc.ac.cn

# 修改配置文件
vim /etc/ntp.conf
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server ntp.ntsc.ac.cn

# 启动ntp
systemctl start ntpd

# 设置ntp自动重启
systemctl enable ntp

chrony

yum -y install chrony

systemctl enable chronyd
systemctl restart chronyd
systemctl status chronyd

vim /etc/chrony.conf
# 添加并保存
server ntp.ntsc.ac.cn iburst

systemctl restart chronyd

全部评论