LinuxMid

System clock is wrong: TLS, token and log-time failures

A drifting clock breaks TLS certificates, tokens and log correlation. Check timedatectl for sync status and fix the time service or its network path.

What you see

  • Certificate errors saying the certificate is not yet valid or has expired, on a certificate you know is fine
  • Token or signature errors from cloud APIs
  • Log timestamps that do not line up across servers

What it means

Many security checks compare timestamps: certificate validity, signed requests, token expiry. If the machine's clock is off by more than the allowed margin, valid credentials look invalid.

A server normally keeps time by syncing with an NTP source. If that sync stops, the clock drifts.

How to confirm the cause

  1. 1
    Check the clock and whether it is synchronized
    timedatectl

    Look for System clock synchronized: yes in the output.

  2. 2
    Check the sync service in detail
    timedatectl timesync-status

    Shows the current state of systemd-timesyncd, if that is what the host uses. Hosts that use chrony or ntpd have their own status commands.

Causes and fixes

  • The time service is not running

    HOW TO TELL
    System clock synchronized: no and no active NTP service.
    ROOT CAUSE
    No process is correcting the clock, so it drifts at the hardware's own rate.
    FIX
    Enable the NTP service your distribution uses, then check that timedatectl reports synchronized.
    sudo timedatectl set-ntp true
  • The network path to the time source is blocked

    HOW TO TELL
    The service runs but never reports a successful sync.
    ROOT CAUSE
    A firewall or security group blocks outbound NTP (UDP 123), so the service cannot reach its servers.
    FIX
    Allow outbound UDP 123 to your time servers, or point the service at a server inside your network.

How to stop it coming back

  • Alert when System clock synchronized is not yes.
  • Use the cloud provider's internal time source where there is one.
  • Keep all servers on the same time service so skew stays small.

Keep going

Sources

Linux man-pages (man7.org) and the systemd manual (freedesktop.org), read 18 Nov 2026. Command options were checked against those pages.

Search

Search cheat sheets and projects