Configure NTP and Chrony Time Synchronization on Linux

Accurate time synchronization is critical for Linux servers — required for Kerberos authentication, log correlation, distributed databases, and certificate validity. RHEL 7+ uses Chrony as the recommended NTP implementation.

NTP vs Chrony

FeatureNTP (ntpd)Chrony
Default inRHEL 6RHEL 7+
Sync speedSlow to convergeFast, especially after reboot
VM supportPoorExcellent
Intermittent networksPoorGood
Config file/etc/ntp.conf/etc/chrony.conf
Port123/UDP123/UDP

Configure Chrony (RHEL 7+)

# Install:
# yum install chrony -y

# Configure:
# vim /etc/chrony.conf

server 0.rhel.pool.ntp.org iburst    # public NTP server
server 1.rhel.pool.ntp.org iburst
server 2.rhel.pool.ntp.org iburst
server 3.rhel.pool.ntp.org iburst

# To act as NTP server for local network:
allow 192.168.1.0/24                  # allow clients on this subnet

# Start and enable:
# systemctl start chronyd
# systemctl enable chronyd

# Check sync status:
# chronyc tracking                    # current time source and offset
# chronyc sources -v                  # list configured time sources
# chronyc sourcestats                 # statistics per source

Configure NTP (RHEL 6)

# Install:
# yum install ntp -y

# Configure:
# vim /etc/ntp.conf
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap  # allow subnet

# Start and enable:
# service ntpd start
# chkconfig ntpd on

# Check status:
# ntpstat                             # sync status summary
# ntpq -p                             # list peers (reach and offset)

timedatectl — System Time Management (RHEL 7)

# Show current date, time, timezone and NTP status:
# timedatectl

# Set timezone:
# timedatectl set-timezone Asia/Kolkata
# timedatectl set-timezone America/New_York
# timedatectl list-timezones | grep Asia

# Set date and time manually (when NTP is disabled):
# timedatectl set-time "2026-06-07 14:30:00"

# Enable/disable NTP sync:
# timedatectl set-ntp true
# timedatectl set-ntp false

Firewall for NTP

# RHEL 7:
# firewall-cmd --permanent --add-service=ntp
# firewall-cmd --reload

# RHEL 6:
# iptables -A INPUT -p udp --dport 123 -j ACCEPT
# service iptables save

Useful Time Commands

# date                               # show current date/time
# date -d "+45 days"                 # date 45 days from now
# date +%Y%m%d                       # date in YYYYMMDD format
# hwclock                            # hardware clock
# hwclock --systohc                  # sync hardware clock from system time
# hwclock --hctosys                  # sync system time from hardware clock