Trying to sync my computer's clock because KeepassXC's TOTPs are wrong.
- Login o registrati per inviare commenti
I am trying to synchronize my computer's clock.
I read about ntp on an Ubuntu forum[1], then found this: https://trisquel.info/en/wiki/enable-time-synchronization-ntp
As suggested in the wiki, I tried:
$ sudo apt install systemd-timesyncd
$ sudo timedatectl set-ntp true
$ timedatectl status
However when I run '$ timedatectl status', my system's clock is still not synchronized:
Local time: Wed 2025-11-26 redacted
Universal time: Wed 2025-11-26 20:59:07 UTC
RTC time: Wed 2025-11-26 20:59:08
Time zone: redacted
System clock synchronized: no
NTP service: active # used to be 'n/a' before installing systemd-timesyncf and running 'timedatectl set-ntp true'
RTC in local TZ: no
I also tried running '$ systemctl restart systemd-timesyncd' after '$timedatectl set-ntp true' in vain, and rebooting also.
On the web, I read about using chrony.
What's your view on this? I am wondering whether I shall install npt and use it as suggested there[2], or chrony maybe, or, whether I can sync my system's clock without installing additional programmes (other than systemd-timesyncd)?
I am trying to sync my system's clock because KeepassXC's TOTPs are wrong.[3]
PS: I am keen to update https://trisquel.info/en/wiki/enable-time-synchronization-ntp if it needs modification.
[1]: https://askubuntu.com/questions/1046214/enable-system-clock-synchronization
[2]: https://askubuntu.com/a/1046217
[3]: https://github.com/keepassxreboot/keepassxc/issues/10807#issuecomment-2131177278
What is the output of this?
sudo systemctl status systemd-timesyncd.service
Hi Avron, this:
$ sudo systemctl status systemd-timesyncd.service
[sudo] password for redacted:
○ systemd-timesyncd.service
Loaded: masked (Reason: Unit systemd-timesyncd.service is masked.)
Active: inactive (dead)
When I run the command suggested in the wiki https://trisquel.info/en/wiki/enable-time-synchronization-ntp:
$ sudo apt install systemd-timesyncd
$ sudo timedatectl set-ntp true
$ sudo systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2025-11-27 redacted; 5s ago
Docs: man:systemd-timesyncd.service(8)
Main PID: 4791 (systemd-timesyn)
Status: "Daemon is running"
Tasks: 1 (limit: 9166)
Memory: 1.1M
CPU: 95ms
CGroup: /system.slice/systemd-timesyncd.service
└─4791 /lib/systemd/systemd-timesyncd
Nov 27 redacted x220 systemd[1]: Starting Network Time Synchronization...
Nov 27 redacted x220 systemd[1]: Started Network Time Synchronization.
And:
$ timedatectl status
Local time: redacted
Universal time: Thu 2025-11-27 22:05:55 UTC
RTC time: Thu 2025-11-27 22:05:55
Time zone: redacted
System clock synchronized: no
NTP service: active
RTC in local TZ: no
This should give you some clues about what is going on:
journalctl --unit=systemd-timesyncd.service
Thanks, prospero. I just ran the command. The output suggests that synchronisation is happening, however when I run 'timedatectl status', I still get 'System clock synchronized: no'.
$ timedatectl status | grep sync -A 1
System clock synchronized: no
NTP service: active
$ sudo systemctl status systemd-timesyncd.service | grep active
Active: active (running) since Sat 2025-11-29 02:16:33 CET; 4min 0s ago
and
$ journalctl --unit=systemd-timesyncd.service
[...]
Nov 26 22:19:36 x220 systemd[1]: Stopped Network Time Synchronization.
Nov 26 22:19:36 x220 systemd[1]: Starting Network Time Synchronization...
Nov 26 22:19:36 x220 systemd[1]: Started Network Time Synchronization.
Nov 26 22:22:20 x220 systemd[1]: Stopping Network Time Synchronization...
Nov 26 22:22:20 x220 systemd[1]: systemd-timesyncd.service: Deactivated successfully.
Nov 26 22:22:20 x220 systemd[1]: Stopped Network Time Synchronization.
-- Boot 2e152a63585746fcaf3dfeed62249469 --
Nov 26 22:24:24 x220 systemd[1]: Starting Network Time Synchronization...
Nov 26 22:24:24 x220 systemd[1]: Started Network Time Synchronization.
Nov 26 22:25:17 x220 systemd[1]: Stopping Network Time Synchronization...
Nov 26 22:25:17 x220 systemd[1]: systemd-timesyncd.service: Deactivated successfully.
Nov 26 22:25:17 x220 systemd[1]: Stopped Network Time Synchronization.
-- Boot 92b2946090054d00a0a6b96dd47d798b --
Nov 27 23:02:55 x220 systemd[1]: Starting Network Time Synchronization...
Nov 27 23:02:55 x220 systemd[1]: Started Network Time Synchronization.
Nov 28 00:12:20 x220 systemd[1]: Stopping Network Time Synchronization...
Nov 28 00:12:20 x220 systemd[1]: systemd-timesyncd.service: Deactivated successfully.
Nov 28 00:12:20 x220 systemd[1]: Stopped Network Time Synchronization.
-- Boot e497ed24159943c2b4d0aad487e44db9 --
Nov 28 08:49:42 x220 systemd[1]: Starting Network Time Synchronization...
Nov 28 08:49:43 x220 systemd[1]: Started Network Time Synchronization.
Nov 28 11:01:28 x220 systemd[1]: Stopping Network Time Synchronization...
Nov 28 11:01:28 x220 systemd[1]: systemd-timesyncd.service: Deactivated successfully.
Nov 28 11:01:28 x220 systemd[1]: Stopped Network Time Synchronization.
-- Boot 56956e3e865349d283c44407fa3dc1fe --
Nov 29 01:48:09 x220 systemd[1]: Starting Network Time Synchronization...
Nov 29 01:48:10 x220 systemd[1]: Started Network Time Synchronization.
Nov 29 02:16:24 x220 systemd[1]: Stopping Network Time Synchronization...
Nov 29 02:16:24 x220 systemd[1]: systemd-timesyncd.service: Deactivated successfully.
Nov 29 02:16:24 x220 systemd[1]: Stopped Network Time Synchronization.
Nov 29 02:16:33 x220 systemd[1]: Starting Network Time Synchronization...
Nov 29 02:16:33 x220 systemd[1]: Started Network Time Synchronization.
It looks like you are missing this line after each boot:
systemd-timesyncd[***]: Initial synchronization to time server x.x.x.x:123 (x.debian.pool.ntp.org).
This may give you some extra clues:
timedatectl timesync-status

