Install Chrony and Configure NTP server

In this tutorial, How to Install Chrony and Configure NTP server in Linux. Chrony is used to sync the system clock from different NTP servers.

Chrony with two programs: chronyc is the command-line interface for chrony and chronyd is the daemon that can be started at boot time.

Install chrony

# yum -y install chrony    # CentOS/RHEL
# apt install chrony       # Debian/Ubuntu
# dnf -y install chrony    # Fedora 22+

Configure chrony

[vagrant@DevopsRoles ~]$ sudo vi /etc/chrony.conf

Example add lines as below

# change servers for synchronization
#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 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
# Allow NTP client access from local network.
allow 10.0.2.0/24

Start and enable daemon upon boot

[vagrant@DevopsRoles ~]$ sudo systemctl start chronyd 
[vagrant@DevopsRoles ~]$ sudo systemctl enable chronyd

If Firewalld is running, allow port 123/UDP.

[vagrant@DevopsRoles ~]$ sudo firewall-cmd --add-service=ntp --permanent 
[vagrant@DevopsRoles ~]$ sudo firewall-cmd --reload

Check Chrony Synchronization

[vagrant@DevopsRoles ~]$ chronyc sources
[vagrant@DevopsRoles ~]$ chronyc tracking
Install Chrony and Configure NTP server

Conclusion

You have installed Chrony and Configured the NTP server. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.