Trying to sync my computer's clock because KeepassXC's TOTPs are wrong.

3 replies [Last post]
Staircase
Offline
Joined: 02/24/2022

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

Avron

I am a translator!

Offline
Joined: 08/18/2020

What is the output of this?

sudo systemctl status systemd-timesyncd.service
Staircase
Offline
Joined: 02/24/2022

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)

Staircase
Offline
Joined: 02/24/2022

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