CentOS8 同步时间chrony ntpdate已无法使用
在CentOS8中,已使用chrony替代ntp,首先安装chrony
#使用dnf安装
dnf install -y chrony
# 也可以用yum安装
yum install -y chrony
1、安装chrony成功,修改chrony服务的配置文件
1、临时同步时间方法:chronyd -q 'server ntp.ntsc.ac.cn iburst'
2、永久设置同步时间服务器(修改配置文件)
root@localhost ~]# vim /etc/chrony.conf
3、注释掉第三行原有的时间服务器地址,设置为阿里云的时间服务地址
server ntp6.aliyun.com iburst
4、重启网络时间服务chrony,并设置服务后台运行。
#重启时间服务
[root@localhost ~]# systemctl restart chronyd.service
#设置时间同步服务开机启动
[root@localhost ~]# systemctl enable chronyd.service