Inhaltsverzeichnis
An incorrect system time becomes noticeable in many places: logs can no longer be correlated, TLS certificates appear invalid, and Kerberos rejects logins if the deviation is too large.
Linux includes several tools for this purpose, which differ in function and availability. It is important that exactly one time service runs on a system.
Tools at a Glance
| Command/Tool | Available on | Task | Key Commands |
| timedatectl | systemd-based distributions | Display and modify time, timezone, and NTP status | timedatectl, timedatectl set-timezone Europe/Berlin, timedatectl set-ntp true |
| systemctl | systemd-based distributions | Start, stop, and enable time service | systemctl status systemd-timesyncd, systemctl enable systemd-timesyncd |
| systemd-timesyncd | systemd-based distributions, Debian default | Simple NTP client that synchronizes the clock | Configuration in /etc/systemd/timesyncd.conf |
| chrony | Debian, Ubuntu, RHEL, CentOS | Full-featured NTP client and server, also for systems with intermittent connectivity | chronyc tracking, chronyc sources |
| ntpd (package ntp) | older Debian and Ubuntu releases | Classic time service | ntpq -p, configuration in /etc/ntp.conf |
| hwclock | all Linux distributions | Read and set hardware clock (RTC) | hwclock --show, hwclock --systohc |
| date | all Linux distributions | Display or manually set system time | date, date --set "2026-11-22 10:00:00" |
The default service depends on the distribution. Debian uses systemd-timesyncd as the default, with chrony and OpenNTPD available as alternatives. On Debian 12, ntpsec replaced the ntp package, and starting with Debian 13, the ntp package is no longer available. Ubuntu uses chrony as the default starting from version 25.10. timesyncd is a pure client. If you want to provide time in the network yourself or need a full-featured NTP client, install chrony.
Ubuntu and Debian with timedatectl and timesyncd
First, check the current time, time zone, and whether synchronization is running:
timedatectlSet the time zone and enable NTP synchronization:
sudo timedatectl set-timezone Europe/Berlin
sudo timedatectl set-ntp true
timedatectl status`set-ntp true` enables the installed time service. If none is installed, the command fails, and you first install systemd-timesyncd or chrony.
You control the service using systemctl:
systemctl status systemd-timesyncd
sudo systemctl start systemd-timesyncd
sudo systemctl enable systemd-timesyncdYou enter your own NTP servers in /etc/systemd/timesyncd.conf under the [Time] section, then restart the service:
[Time]
NTP=pool.ntp.orgsudo systemctl restart systemd-timesyncd
timedatectl timesync-statuschrony on Ubuntu and Debian
You install chrony via apt. On Debian and Ubuntu, the service is called chrony, not chronyd. During installation, chrony replaces the existing time service. Afterward, use timedatectl to verify that only one service is active, as two time services running simultaneously will interfere with each other.
sudo apt install chrony
sudo nano /etc/chrony/chrony.conf
sudo systemctl restart chronyEnter your NTP servers or pools in the configuration. You can check if the synchronization is working here:
chronyc tracking
chronyc sourceschrony on RHEL and CentOS
On RHEL and CentOS, the service is called chronyd, and the configuration file is located at /etc/chrony.conf. chrony is usually pre-installed. If it is not, you install it:
sudo dnf install chrony
sudo nano /etc/chrony.confAdd an NTP server, for example server pool.ntp.org iburst, and start the service:
sudo systemctl enable --now chronydntpd on older Ubuntu systems
On current releases, you won't find ntpd anymore, and the package isn't available on Debian 13. On older systems, the classic service runs as follows:
sudo apt install ntp
sudo nano /etc/ntp.conf
sudo systemctl start ntp
ntpq -pIn /etc/ntp.conf, you enter your source with server pool.ntp.org. ntpq -p lists the connected servers.
Synchronize hardware clock
The hardware clock (RTC) runs independently of the system clock and provides the initial time during boot. Align it after correcting the system time:
sudo hwclock --systohc
hwclock --showTo sync the hardware clock to the system clock, use sudo hwclock --hctosys. To write a specific time directly to the hardware clock, run sudo hwclock --set --date="2026-11-22 10:00:00". If you manually set the system time with date --set, an active NTP service will correct it shortly afterward.
More PhinIT articles:
- INFO | Overview of Linux Directories | Where /etc/chrony and /etc/timezone are located
- LINUX | General Information | All Linux guides at a glance
Sources
| Source | Topic | URL |
| Debian Micronews (Bookworm Release) | ntp replaced by ntpsec, timesyncd as default | https://micronews.debian.org/2023/1686452718.html |
| Debian-doc mailing list, Bug 1028149 | When to use timesyncd, ntpsec, or chrony | https://lists.debian.org/debian-doc/2023/03/msg00030.html |
| Ubuntu Server Documentation | chrony as default from Ubuntu 25.10, service name chrony.service | https://documentation.ubuntu.com/server/how-to/networking/chrony-client |
| Debian Trixie: Anleitung zum Sichern eines Linux-Servers | ntp package removed in Debian 13, configure timesyncd | https://www.mintlify.com/imthenachoman/How-To-Secure-A-Linux-Server/basics/ntp |
| Ubuntu Launchpad Bug 1870144 | Konflikt durch gleichzeitig laufende Zeitdienste | https://answers.launchpad.net/bugs/1870144 |