How to configure Chrony on Linux

Home > Search > How-to
  by

Use the date command  to view the current date and time the server has.

[root@server1 ~]# date
Mon Jan 01 00:01:01 CDT 2016

 

Use apt-get or yum to install Chrony.

[root@server1 ~]# apt-get install chrony
[root@server1 ~]# yum install chrony

 

In the /etc/chrony.conf file, configure the server to allow client PCs in the subnet to connect to the server. In this example, the server is configured to allow PCs in the 192.168.0.0/24 network.

allow 192.168.0.0/24

 

Also ensure the four server directives are not commented out. Replace "distro" with a Linux distro, such as CentOS, Ubuntu, or Fedora.

server 0.distro.pool.ntp.org iburst
server 1.distro.pool.ntp.org iburst
server 2.distro.pool.ntp.org iburst
server 3.distro.pool.ntp.org iburst

 

Restart chrony, and ensure chrony is active and running.

[root@server1 ~]# systemctl restart chronyd
[root@server1 ~]# systemctl status chronyd

 

Configure chrony to be enabled at boot.

[root@server1 ~]# systemctl enable chronyd

 

Use the chronyc sources command to verify that chrony is able to connect to external NTP servers.

[root@server1 ~]# chronyc sources
210 Number of sources = 4MS 
Name/IP address   Stratum  Poll  Reach  LastRx  Last sample
=============================================================================
^* example.com             2    10    377     160  +5942us[-1824us] +/-  48ms
^+ example.com             1     8    377     193    -23ms[-  30ms] +/-  56ms
^+ example.com             2    10    377     29m  +6399us[+7465us] +/-  71ms
^+ example.com             2    10    363      49  +6380us[-6380us] +/-  35ms

 

Use the chronyc tracking command to verify that the machine is synchronized.  If Leap status is “normal”, the machine is synchronized.  On the other hand, if leap status is “not synchronized”, the machine is not synchronized.

[root@server1 ~]# chronyc tracking
. . .
Leap status : Normal

 

Use the date command to verify the server is getting the correct date and time from the NTP pool.

[root@server1 ~]# date
Mon Jan 01 08:30:01 CDT 2017

 

It is important to recognize that some time zones use both Standard Time and Daylight Savings Time. In the prior output, the date and time is in Central Daylight Time (CDT). When Daylight Savings Time is not being observed, the date and time should be in Central Standard Time (CST). In this time zone, CDT is 5 hours behind Coordinated Universal Time (UTC), and CST is 6 hours behind Coordinated Universal Time (UTC). Daylight Savings Time is generally observed from early March to early November, and Standard Time is generally observed from early November to early March.

Other computers can now use the Chrony server for time management.

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments