5.1. Server

5.1.1. Setting Up Chrony

$ sudo apt install chrony

Note

Besides from the highlighted lines, the following configuration for chrony should be equivalent to the default configuration.

Listing 5.1 /etc/chrony/chrony.conf
 1# Welcome to the chrony configuration file. See chrony.conf(5) for more
 2# information about usable directives.
 3
 4# Include configuration files found in /etc/chrony/conf.d.
 5confdir /etc/chrony/conf.d
 6
 7pool ntp.ubuntu.com        iburst maxsources 4
 8pool 0.ubuntu.pool.ntp.org iburst maxsources 1
 9pool 1.ubuntu.pool.ntp.org iburst maxsources 1
10pool 2.ubuntu.pool.ntp.org iburst maxsources 2
11
12# Use time sources from DHCP.
13sourcedir /run/chrony-dhcp
14
15# Use NTP sources found in /etc/chrony/sources.d.
16sourcedir /etc/chrony/sources.d
17
18# This directive specify the location of the file containing ID/key pairs for
19# NTP authentication.
20keyfile /etc/chrony/chrony.keys
21
22# This directive specify the file into which chronyd will store the rate
23# information.
24driftfile /var/lib/chrony/chrony.drift
25
26# Save NTS keys and cookies.
27ntsdumpdir /var/lib/chrony
28
29# Uncomment the following line to turn logging on.
30#log tracking measurements statistics
31
32# Log files location.
33logdir /var/log/chrony
34
35# Stop bad estimates upsetting machine clock.
36maxupdateskew 100.0
37
38# This directive enables kernel synchronisation (every 11 minutes) of the
39# real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
40rtcsync
41
42# Step the system clock instead of slewing it if the adjustment is larger than
43# one second, but only in the first three clock updates.
44makestep 1 3
45
46# Get TAI-UTC offset and leap seconds from the system tz database.
47# This directive must be commented out when using time sources serving
48# leap-smeared time.
49leapsectz right/UTC
50
51ALLOW 192.168.0.0/24
52LOCAL STRATUM 8
$ sudo systemctl restart chrony