Courseiva
LFCSChapter 16 of 16Objective 6.2

Time Synchronization with NTP and Chrony

What does time have to do with passing the LFCS exam? Without a consistent, accurate system clock, your Linux server cannot authenticate users, schedule backups, sync log files, or even process emails reliably. Time synchronisation ensures that every machine in a network agrees on the current time, and the LFCS exam expects you to know how to configure it using either the older NTP service or the modern Chrony — and to understand when to use each one.

12 min read
Intermediate
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Time Synchronization with NTP and Chrony

The Railway Station Clock Analogy

A busy railway station, the kind with dozens of platforms and trains arriving from all over the country. Each platform has its own clock, hanging from the iron rafters. The station manager looks up at them one morning and notices something alarming: the clock on Platform 3 says 10:15, Platform 7 says 10:22, and the big clock above the ticket office says 10:18. None of them agree. A passenger following the Platform 3 clock will miss their connection on Platform 7 because those two clocks are seven minutes apart. The whole timetable — every departure and arrival — becomes useless. Chaos spreads through the station. Passengers miss trains, trains block platforms, and the entire operation grinds to a halt.

That is exactly what happens inside a computer network when the clocks on different servers do not agree. In computing, this problem is called clock skew, and it breaks almost everything that depends on timestamps — logs, emails, database transactions, scheduled tasks, and authentication tickets. The station manager solves the problem by designating one master clock — perhaps the one at the national observatory or the station's most trusted atomic clock — and telling every other clock to synchronise itself to that single source of truth. That master clock is the time server. Each platform clock then regularly checks in and adjusts itself to match. This is precisely what NTP (Network Time Protocol) does for computers: it keeps every machine's clock aligned to a reference time source, so that all systems in the network agree on what time it is. Without this, your servers become as unreliable as a station where no two clocks show the same hour.

How It Actually Works

Imagine you are responsible for a dozen Linux servers spread across two data centers. One server handles email, another runs the company's database, and a third processes financial transactions. If their clocks drift apart by even a few seconds, problems cascade. An email sent at 10:05 from Server A might appear to arrive at Server B at 09:59 — that breaks message ordering and makes audits impossible. A scheduled backup that fires at 02:00 on Server C might run at 01:55 on Server D, causing a race condition where both try to lock the same file. This is why every production Linux system must run a time synchronisation service.

The fundamental tool for this job is the Network Time Protocol, or NTP. NTP is an internet protocol — a set of rules that computers follow to communicate — designed specifically to synchronise clocks over a network. It works in a client-server model. The client (your server) sends a request to an NTP server asking, "What time is it?" The server replies with its current timestamp. But the client does not just accept that timestamp blindly. It calculates the network round-trip delay — the time it took for the request to travel to the server and the reply to come back — and uses that to estimate the actual current time at the server. It then adjusts its own system clock gradually, either speeding it up or slowing it down, so that it converges on the correct time. This correction is called slewing. NTP can achieve accuracy within a few milliseconds over the public internet and within microseconds on a local network.

The NTP ecosystem has a hierarchy, called a stratum. At the top, stratum 0 devices are physical clocks — atomic clocks, GPS receivers, or radio clocks — that are inherently accurate. Stratum 1 servers are computers directly connected to a stratum 0 device. Stratum 2 servers sync from stratum 1 servers, stratum 3 from stratum 2, and so on. The higher the stratum number, the further you are from the reference clock, but also the more resilient you are because you can sync from multiple upstream servers. In practice, most organisations run their own internal NTP server at stratum 2 or 3 and point their other machines to it.

For many years, the standard Linux implementation of NTP was a service called ntpd (NTP daemon). A daemon is just a background process that runs continuously. Ntpd works well, but it has limitations. It is designed for servers that are always on and always connected. If you have a laptop that sleeps, a virtual machine that gets suspended and resumed, or a server that loses network connectivity for hours, ntpd takes a long time to re-synchronise after it comes back. It also tends to keep the clock stable rather than correcting big offsets quickly. This is where Chrony enters the picture.

Chrony is a newer, more modern implementation of NTP. It is now the default time synchronisation service on most major Linux distributions, including RHEL 8 and later, CentOS 8, Fedora, and Ubuntu. Chrony consists of two main programs: chronyd, the daemon that runs in the background, and chronyc, a command-line tool that lets you interact with the daemon. Chrony is designed to work well in environments where the network is intermittent, where the system clock drifts rapidly (common on virtual machines that share a physical host), or where you need fast initial synchronisation after boot. It does this by keeping a record of the system's drift rate — how much the clock gains or loses per hour — and using that information to make smarter corrections.

Both ntpd and Chrony use the same underlying NTP protocol, so they can talk to the same time servers. The key differences are in their behaviour and tuning. Chrony is typically more accurate for machines that are not always on, because it learns the drift rate over time and can compensate immediately after a reboot. Ntpd is better suited for servers that remain powered on for months at a time, because it smooths out small variations more gently. For the LFCS exam, you need to know how to install, configure, start, enable, and verify both services. The configuration files are:

For Chrony: /etc/chrony.conf

For the legacy NTP service: /etc/ntp.conf

Both files follow a similar structure. You define a list of NTP server addresses using the 'server' or 'pool' directive. A pool is a group of servers, often provided by projects like the NTP Pool Project (pool.ntp.org), that rotate through a set of public NTP servers for load balancing. You can also define 'peer' directives if you want machines to synchronise with each other as equals. After editing the configuration file, you restart the service and verify it is working. For Chrony, the verification command is 'chronyc sources -v'. For ntpd, it is 'ntpq -p'.

Another important concept is the local clock fallback. If your server cannot reach any NTP server, you can configure it to use its own internal clock as a last resort. This is done with the 'local stratum 10' directive in chrony.conf or 'server 127.127.1.0' for the legacy NTP. The stratum value is set high (like 10) so that other machines know this source is less reliable.

Security is also a consideration. The NTP protocol can be authenticated to prevent an attacker from sending fake time updates. Chrony supports authentication using a shared key stored in the /etc/chrony.keys file. The LFCS exam may ask you to enable this. Finally, both services can act as a time server for other machines on your network, not just as a client. You configure this by setting the 'allow' directive in chrony.conf to specify which network addresses or subnets are permitted to query your server.

This diagram shows the NTP stratum hierarchy from an atomic clock down to client servers, and how chronyc sources output symbols indicate the status of each time source.

Walk-Through

1

Install Chrony

On RHEL/CentOS/Fedora, run 'dnf install chrony'. On Ubuntu/Debian, run 'apt install chrony'. This installs the chronyd daemon and the chronyc command-line tool.

2

Edit the Configuration File

Open /etc/chrony.conf with a text editor. Add 'server' or 'pool' lines for your NTP sources, e.g., 'server 0.pool.ntp.org iburst'. The 'iburst' option sends a quick burst of packets on startup for faster sync.

3

Configure Server and Fallback Settings

Add an 'allow' line to permit client queries from your subnet, e.g., 'allow 192.168.1.0/24'. Add 'local stratum 10' to provide a fallback clock. Adjust 'makestep 1.0 3' to allow stepping the clock on large offsets.

4

Start and Enable the Chrony Service

Run 'systemctl enable --now chronyd' to start the daemon immediately and enable it to start on boot. Check the status with 'systemctl status chronyd' to confirm it is running without errors.

5

Verify Synchronisation

Run 'chronyc sources -v' to see the list of NTP sources. Look for a '*' next to the active source. Run 'chronyc tracking' to see detailed information including current offset, stratum, and drift rate.

6

Configure the Firewall

If your server will answer NTP queries from other machines, open UDP port 123 in the firewall. On RHEL, use 'firewall-cmd --add-service=ntp --permanent && firewall-cmd --reload'.

What This Looks Like on the Job

You work as a junior system administrator for a mid-sized e-commerce company. The company runs its online store on a cluster of six Linux web servers, plus two database servers and a load balancer. The compliance officer sends an urgent email: the company's logs show that a security incident on Tuesday at 14:37 UTC was reported, but the logs from three different servers show timestamps of 14:37, 14:39, and 14:35. The auditors cannot reconstruct the sequence of events. You are told to fix time synchronisation across the entire fleet — permanently.

Your first step is to assess what is already running. You SSH into each server and run 'chronyc tracking' and 'systemctl status chronyd'. On one database server, Chrony is not even installed. On another, it is running but pointing to an NTP server that has been decommissioned. On four of the web servers, the older ntpd service is running instead of Chrony. The company wants a standardised approach, so you decide to migrate everything to Chrony.

You start by editing the configuration on a single test server. The /etc/chrony.conf file needs at least three good NTP sources for reliability. You choose three public NTP servers from the NTP Pool Project, and you add one internal server — the company's own stratum 2 server that syncs from a GPS clock. The configuration looks like this: - server 0.pool.ntp.org iburst - server 1.pool.ntp.org iburst - server 2.pool.ntp.org iburst - server ntp.internal.company.local iburst

The 'iburst' option tells Chrony to send a burst of quick requests immediately after startup, so it synchronises faster on boot. You then add an 'allow' directive to let other machines on the internal 10.0.0.0/24 subnet query this server. Finally, you set the local stratum to 10 as a fallback so this server can still respond to queries even if all upstream NTP servers become unreachable.

After restarting chronyd with 'systemctl restart chronyd', you verify with 'chronyc sources -v'. You see that all four sources are reachable and marked with '*' (the current best source) or '+' (acceptable sources). The offset shows less than 2 milliseconds. You test the fallback by temporarily blocking outbound NTP traffic with iptables and then running 'chronyc sources -v' again. The sources show '?' meaning unreachable, but the local clock is being used.

Next, you write an Ansible playbook to deploy this configuration to all remaining servers. You push the same /etc/chrony.conf file to every machine, enable chronyd with 'systemctl enable --now chronyd', and verify the output of 'chronyc tracking' across all hosts. You also configure the firewall to allow NTP traffic (UDP port 123) only from trusted sources.

Finally, you update the company's runbook documentation. You include the commands to check synchronisation status, a procedure for adding a new NTP server, and a troubleshooting section that covers common issues like firewall blocks, incorrect DNS resolution for the NTP hostnames, and the fact that virtual machines often need a different drift handling strategy. The compliance officer signs off after the next audit shows all logs within 50 milliseconds of each other. This is what real-world time management looks like: audit-proofing your infrastructure, one protocol at a time.

How LFCS Actually Tests This

The LFCS exam tests time synchronisation under Objective 6.2, and it does so in a very practical, hands-on way. You will not be asked to recite the history of NTP. Instead, you will be given a scenario — for example, "A system administrator needs to configure time synchronisation on a new RHEL 9 server. The server should synchronise with the NTP servers pool.ntp.org and time.google.com, and be able to act as a time server for the 192.168.1.0/24 subnet." From there, you need to edit the configuration file, restart the service, and verify it.

The exam loves to test the differences between ntpd and Chrony. A common question presents both services as options and asks which one is the modern default. The answer is Chrony. Another trap is mixing up the configuration file locations: /etc/chrony.conf for Chrony, /etc/ntp.conf for ntpd. An exam question might deliberately swap these file names in the answer choices.

Here are the exact concepts LFCS tests repeatedly:

Knowing the default time synchronisation service for the distribution in the exam (RHEL/CentOS 8+ uses Chrony).

Editing /etc/chrony.conf to add 'server' and 'pool' directives.

Using the 'iburst' option to speed up initial synchronisation.

Using the 'allow' directive to permit client queries from a specific subnet.

Using the 'local stratum 10' directive for fallback.

Starting, enabling, and checking the status of chronyd with systemctl.

Running 'chronyc sources -v' and interpreting the output — specifically the symbols *, +, ?, and x. * means the current synchronisation source, + means a candidate source, ? means unreachable, x means the source was rejected.

Running 'chronyc tracking' to see the system's current time offset, drift rate, and stratum.

Understanding that 'timedatectl' can show NTP status but is not a substitute for Chrony configuration.

The traps to watch out for:

Configuration directives that look similar but do different things: 'server' specifies a single NTP server, 'pool' specifies a pool of servers. Mixing them up causes a wrong answer.

The 'makestep' directive in /etc/chrony.conf. If you forget to include it, Chrony will only slew the clock — it will never step (jump) the time, even if the offset is huge. For virtual machines that are resumed from suspension, this can mean hours of inaccurate time. The correct setting is 'makestep 1.0 3', which means step the clock if the offset is greater than 1 second, but only in the first three updates after boot.

For the legacy NTP (ntpd), the exam may ask you to use 'ntpq -p' or 'ntpstat' to verify synchronisation. Do not confuse these with chronyc commands.

The NTP port number is UDP 123. Firewall configuration questions often use this.

Authentication: the file /etc/chrony.keys stores keys, and the 'key' directive in chrony.conf references a specific key number. The exam might ask you to set up symmetric key authentication between two servers.

In short, you need to be comfortable editing a text configuration file for a time service, restarting that service, and interpreting a simple status command. The exam will not ask you to compile NTP from source or debug complex network latency. Stick to the configuration essentials, and you will pass this objective.

Key Takeaways

Chrony is the default time synchronisation service on RHEL 8+ and most modern Linux distributions.

The Chrony configuration file is /etc/chrony.conf, and the verification command is 'chronyc sources -v'.

The 'iburst' option in the 'server' directive speeds up initial synchronisation after boot.

The 'allow' directive in /etc/chrony.conf specifies which subnets can query your Chrony server.

The 'makestep' directive controls whether Chrony can jump the clock forward or backward when the offset is large.

The NTP protocol uses UDP port 123, so your firewall must permit this port for synchronisation to work.

The 'timedatectl' command shows NTP status but does not replace Chrony or ntpd configuration.

A local clock fallback is configured with 'local stratum 10' in chrony.conf to provide time when upstream servers are unavailable.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Chrony

Default on RHEL 8+ and most modern distributions

Handles intermittent network and suspended VMs better

Configuration file is /etc/chrony.conf

NTP (ntpd)

Legacy service, not default on newer distributions

Best for always-on servers with stable connectivity

Configuration file is /etc/ntp.conf

server directive

Specifies a single NTP server hostname or IP

Use when you know the exact server you want

Example: server 0.pool.ntp.org iburst

pool directive

Specifies a pool of servers that rotate automatically

Provides built-in load balancing and redundancy

Example: pool 0.pool.ntp.org iburst

slew (gradual adjustment)

Clock is sped up or slowed down slightly over time

Ideal for small offsets under 1 second

Does not break applications that expect monotonic time

step (instant jump)

Clock is instantly set to the correct time

Used for large offsets, controlled by makestep directive

Can cause timestamps to go backwards briefly

Watch Out for These

Mistake

You must manually set the system clock with the 'date' command, and time synchronisation services are optional.

Correct

Manual time setting is only for temporary fixes. NTP or Chrony must run continuously to keep the clock accurate, because hardware clocks drift over time.

Many beginners come from desktop environments where they never worry about clock drift. On servers that run for months, drift accumulates into minutes or hours.

Mistake

Chrony and NTP are completely different protocols and cannot talk to each other.

Correct

Chrony implements the same NTP protocol as ntpd. A Chrony client can synchronise with an ntpd server, and vice versa.

The different names suggest they are unrelated, but Chrony is just a different implementation of the same standard protocol.

Mistake

If you add multiple 'server' lines in chrony.conf, Chrony will use all of them simultaneously and average the timestamps.

Correct

Chrony selects one server as the reference (marked with *) from the pool of reachable servers. It does not average all sources. It picks the best one based on stratum and distance.

People assume more servers means more precision through averaging, but NTP uses a selection algorithm that discards outliers and picks a single best source.

Mistake

The 'local stratum 10' directive is only needed if you want to act as a time server for others.

Correct

Even if you never serve time to other machines, setting 'local stratum 10' ensures that your server has a fallback when all NTP servers are unreachable, preventing it from losing its clock entirely.

Beginners see 'local' and think it relates only to being a server, but it is a safety net for the local system's own clock stability.

Mistake

You must stop and disable Chrony if you want to use ntpd instead.

Correct

You can have both installed, but they cannot run simultaneously because both try to control the same system clock. You must stop and disable one before starting and enabling the other.

Students think package managers prevent conflicts, but the conflict is at runtime, not installation time. Both services can be installed but will fight over the clock if both are active.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between ntpd and chronyd?

Both implement the NTP protocol, but chronyd is newer and better for virtual machines, laptops, and systems with intermittent network connectivity. Ntpd is older and works well for always-on servers.

How do I check if time synchronisation is working on my Linux server?

Run 'chronyc sources -v' if you use Chrony, or 'ntpq -p' if you use ntpd. Look for a server marked with '*' — that is your current synchronisation source.

What does the 'iburst' option do in /etc/chrony.conf?

It sends a burst of four quick NTP requests immediately after the service starts, which speeds up the initial synchronisation and reduces the time needed to achieve accurate time.

Can I run both Chrony and ntpd at the same time?

No. Only one time synchronisation daemon can control the system clock at a time. You must stop and disable one before starting the other.

What is the 'local stratum 10' directive used for?

It tells Chrony to keep running and provide time even if all upstream NTP servers are unreachable, using the local system clock as a fallback. The high stratum value signals that this source is less reliable.

How do I allow other machines on my network to sync time from my Chrony server?

Add an 'allow' directive in /etc/chrony.conf followed by the subnet, for example 'allow 192.168.1.0/24'. Then restart chronyd and open UDP port 123 in the firewall.

What does 'makestep 1.0 3' mean in the Chrony configuration?

It tells Chrony to step (jump) the clock if the time offset is greater than 1 second, but only during the first three clock updates after the daemon starts. After that, it only slews (gradually adjusts) the clock.

Terms Worth Knowing

Keep going

You've finished Time Synchronization with NTP and Chrony. Continue through the LFCS study guide to build a complete picture of the exam.

Done with this chapter?