The Network Time Server maintains the system time in synchronization with time servers using the Network Time Protocol to provide accurate timing for server log records and other security-sensitive functions.  Chrony is best used on systems that are infrequently connected to the network, such as a laptop or desktop that is powered down often.

 

Install NTP and configure time server.

yum -y install chrony

Edit the NTP configuration file.  Disable CentOS NTP pools by remarking existing lines with # and configure to NTP server of your choice.  I've configured this to the NIST National Institute of Standards and Technology.

nano /etc/chrony.conf 

#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 time.nist.gov iburst

Configure NTP server to automatically start on server reboot.

systemctl enable chronyd
systemctl start chronyd

Configure the firewall.  The time server protocol NTP uses 123/UDP.

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

Loading Conversation