Hur man synkroniserar tid i Linux-server med hjälp av Chrony
Tid spelar en viktig roll i Linux-servrar speciellt när de används i banker, aktiemarknader och andra finansiella sektorer. Om vi vill att alla våra Linux-servrar ska ha rätt tid måste vi konfigurera vissa NTP-klienter som alltid hämtar rätt tid från fjärr NTP-servrar och vid behov gör de justeringar som krävs för att synkronisera tiden.
I den här artikeln kommer vi att visa hur vi kan synkronisera tid med NTP-servrar i Linux-server med hjälp av Chrony (NTP Client).
Installera Chrony på CentOS / RHEL / Fedora System
Utför följande kommando yum eller dnf för att installera Chrony på CentOS, RHEL och Fedora System
~]# yum install chrony -y
Or
~]# dnf install chrony -y
Install Chrony on Debian / Ubuntu System
To install Chrony on Debian and Ubuntu Systems, run the following apt command,
~]$ sudo apt install chrony -y
Once the chrony is installed on Linux server then it offers two programs,
- chronyc : It is command line interface of chrony
- chronyd : It is daemon for chrony which start and enable chrony service across the reboot.
Configuration File of Chrony
Configuration file for Chrony is “/etc/chrony.conf” , sample chrony.conf file is listed below,
~]# cat /etc/chrony.conf

Where:
- pool 0.europe.pool.ntp.org iburst is the remote NTP server from where chrony will fetch the time.
- makestep 1.0 3 is the parameter which will step system clock (speedup or slow down) if adjustment is larger than 1 second but only for first 3 clock updates
- keyfile /etc/chrony.keys as the name suggest this file contains keys for NTP authentication.
- logdir /var/log/chrony , it is the log file which logs of Chrony.
- driftfile /var/lib/chrony/drift is the drift file which contains drift data