Operations 6 min read

Master Linux Time Sync with Chrony: Install, Configure, and Command Guide

This guide walks through installing Chrony on Linux, configuring its daemon and chrony.conf for both server and client roles, using chronyc commands to monitor synchronization, and managing time zones with timedatectl, providing all necessary commands and examples.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Linux Time Sync with Chrony: Install, Configure, and Command Guide

Installation and Configuration

Install chrony, enable and start the daemon, then edit /etc/chrony.conf with the default settings shown.

yum -y install chrony
systemctl enable chronyd
systemctl start chronyd
vim /etc/chrony.conf

Default chrony.conf includes public pool servers, driftfile, makestep, rtcsync, and other common options.

# Use public servers from the pool.ntp.org project.
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

driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
#hwtimestamp *
#minsources 2
#allow 192.168.0.0/16
#local stratum 10
#keyfile /etc/chrony.keys
logdir /var/log/chrony
#log measurements statistics tracking

Usage

Server configuration

Modify chrony.conf to use internal NTP servers and allow the local network.

# Use public servers from the pool.ntp.org project.
server s1a.time.edu.cn iburst
server ntp.aliyun.com iburst
allow 192.168.8.0/24

Enable synchronization:

systemctl enable chronyd
systemctl restart chronyd
timedatectl status
timedatectl set-ntp true

Client configuration

Set the client to use a local NTP server and allow its address.

# Use public servers from the pool.ntp.org project.
server 192.168.8.5 iburst
allow 192.168.8.5

Enable synchronization (same commands as server).

systemctl enable chronyd
systemctl restart chronyd
timedatectl status
timedatectl set-ntp true

Commands

Common chronyc commands for monitoring:

# Show NTP sources
chronyc sources -v
# Show source statistics
chronyc sourcestats -v
# Show activity
chronyc activity -v
# Show tracking information
chronyc tracking -v

Timezone management with timedatectl:

timedatectl
timedatectl list-timezones
timedatectl set-timezone Asia/Shanghai
timedatectl set-time "2019-09-19 15:50:20"
timedatectl set-ntp true
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

NTPtime synchronizationchronyChronyc
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.