Ensure systemd-timesyncd is configured - NTP


systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network. It implements an SNTP client. In contrast to NTP implementations such as chrony or the NTP reference server this only implements a client side, and does not bother with the full NTP complexity, focusing only on querying time from one remote server and synchronizing the local clock to it. The daemon runs with minimal privileges, and has been hooked up with networkd to only operate when network connectivity is available. The daemon saves the current clock to disk every time a new NTP sync has been acquired, and uses this to possibly correct the system clock early at bootup, in order to accommodate for systems that lack an RTC such as the Raspberry Pi and embedded devices, and make sure that time monotonically progresses on these systems, even if it is not always correct. To make use of this daemon a new system user and group 'systemd-timesync' needs to be created on installation of systemd.


If chrony or ntp are used, systemd-timesyncd should be stopped and masked, and this section skipped

This recommendation only applies if timesyncd is in use on the system

Only one time synchronization method should be in use on the system


Proper configuration is vital to ensuring time synchronization is working properly.


Remove additional time synchronization methods:

Run the following commands to remove ntp and chrony:

# apt purge ntp
# apt purge chrony

Configure systemd-timesyncd:

Run the following command to enable systemd-timesyncd

# systemctl enable systemd-timesyncd.service

Edit the file /etc/systemd/timesyncd.conf and add/modify the following lines:

NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org #Servers listed should be In Accordence With Local Policy

FallbackNTP=2.debian.pool.ntp.org 3.debian.pool.ntp.org #Servers listed should be In Accordence With Local Policy

RootDistanceMax=1 #should be In Accordence With Local Policy

Run the following commands to start systemd-timesyncd.service

# systemctl start systemd-timesyncd.service

# timedatectl set-ntp true

Additional Information:

The systemd-timesyncd service specifically implements only SNTP. This minimalistic service will set the system clock for large offsets or slowly adjust it for smaller deltas. More complex use cases are not covered by systemd-timesyncd

See Also


Item Details


References: 800-53|AU-8(1)

Plugin: Unix

Control ID: bdea64f9cbba24fa7c8086ba83950dd3306a0f72f5a063df2506dd70b0b01cf8