Centos中怎么安装并使用Chrony

发布时间:2022-02-17 09:48:41 作者:iii
来源:亿速云 阅读:269

这篇文章主要介绍“Centos中怎么安装并使用Chrony”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Centos中怎么安装并使用Chrony”文章能帮助大家解决问题。

Chrony是一个开源的自由软件,它能帮助你保持系统时钟与时钟服务器(NTP)同步,因此让你的时间保持精确,Centos中安装并使用Chrony具体方法。

Centos中怎么安装并使用Chrony

安装

sudo dnf install chrony -y
sudo yum install chrony -y

Centos8使用firewalld服务对防火墙进行管理。放行ntp服务(123/udp)

firewall-cmd --add-service=ntp --permanent && firewall-cmd --reload

作为服务器端

配置chrony服务端

sudo vim /etc/chrony.conf

删除配置自带的NTP服务器。换成国内阿里云的NTP服务器地址。

添加上游NTP服务器

server time1.aliyun.com iburst    
server time2.aliyun.com iburst
server time3.aliyun.com iburst

允许 192.168.1.0/24 内的客户端通过这台服务器获取时间

allow 192.168.1.0/24

配置无误后,重启chrony服务,并配置开机自启动:

systemctl restart chronyd.service
systemctl enable chronyd.service

使用ss -tlunp | grep chrony或者 lsof -i:123命令检查chrony服务使用的123/udp端口是否启动成功

作为客户端

同样安装,然后修改客户端chrony配置文件

sudo vim /etc/chrony.conf# Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).# pool 2.centos.pool.ntp.org iburst

#添加NTP服务器

server time1.aliyun.com iburst    
server time2.aliyun.com iburst
server time3.aliyun.com iburst

如果有自建的chrony客户端也可以自行配置

server 192.168.1.30 iburst

重启chrony客户端服务,重启chrony服务,并配置开机自启动:

systemctl restart chronyd.service && systemctl enable chronyd.service --now

查看同步状态

chronyc sources -v

关于“Centos中怎么安装并使用Chrony”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注亿速云行业资讯频道,小编每天都会为大家更新不同的知识点。

推荐阅读:
  1. CentOS安装并设置MariaDB
  2. CentOS下怎么安装并使用ProFTPd

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

centos chrony

上一篇:Linux下如何安装Postfix邮件WebMail配置

下一篇:Linux下如何安装Postfix使用maildrop投递邮件

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》