Skip to main content

NTP Time Synchronization

NTP (Network Time Protocol) keeps your SafeSquid server’s clock synchronized with enterprise time sources. Accurate time is critical for SSO/Kerberos authentication, TLS certificate validation, and audit log timestamps. Why you need this: Clock drift breaks Kerberos (requires ≤5 minutes skew), causes TLS certificate errors, and makes log correlation impossible.

Prerequisites

:::note Before You Start
  • Linux host with root/sudo access
  • Enterprise NTP servers or domain controllers providing time
  • Firewall allows UDP port 123 outbound
  • Network connectivity to NTP sources
:::

Installation and Configuration

1. Install Time Synchronization Service

Prefer chrony (modern, faster sync): Debian/Ubuntu:
RHEL/Rocky/CentOS:
Verify installation:
Should print chrony version. :::tip Alternative: ntpd If your environment uses ntpd instead of chrony, install with:
Configuration is similar but uses /etc/ntp.conf. :::

2. Configure Time Sources

Edit chrony configuration:
  • Debian/Ubuntu: /etc/chrony/chrony.conf
  • RHEL/CentOS: /etc/chrony.conf
Replace default pool servers with your enterprise NTP servers:
Explanation:
  • server … iburst — Speeds up initial synchronization
  • makestep 1.0 3 — Allows step (immediate) corrections if offset >1 second, up to 3 times
  • driftfile — Saves clock frequency for faster sync after restart
  • logdir — Where chrony logs are stored
Save and exit.

3. Enable and Start Chrony

Expected: Both commands return active and enabled.

4. Validate Synchronization

Check tracking status:
Expected output:
Key fields:
  • Reference ID: Your NTP server
  • Stratum: Lower is better (1-4 typical)
  • System time offset: Should be within milliseconds (< 0.1 seconds)

Check source status:
Expected output:
Key fields:
  • * (asterisk) — Current best source (should have at least one)
  • Reach — Should be 377 (all recent polls successful)
  • Last sample — Time offset in microseconds/milliseconds

5. Align SafeSquid Authentication

For SSO/Kerberos with Active Directory: Verify time skew is within 5 minutes of the domain controller:
Or use this to compare:
Expected: Offset less than 300 seconds (5 minutes). :::caution Kerberos Requirement Kerberos authentication fails if time skew exceeds 5 minutes. For production Active Directory environments, keep skew under 1 minute. :::

Verify NTP is Working

Check Synchronization Status

Expected:
  • Reference ID: Shows your NTP server (not 0.0.0.0)
  • System time offset: < 0.1 seconds
  • Stratum: 2-4 (depending on your NTP server)

View Source Statistics

Expected: All sources show reasonable offsets and low jitter.

Monitor Logs

Expected log entries:

Troubleshooting

Still not working?
  1. Test NTP server connectivity:
    Should show offset.
  2. Check chrony configuration:
  3. Force time sync:
  4. Check logs:

Production Best Practices

  1. Use at least 3 NTP sources for redundancy:
  2. For Active Directory, prefer domain controllers:
  3. Monitor time drift with Monit: Add to /etc/monit/conf.d/chrony:
  4. Alert on large offsets:
    • Configure monitoring to alert if offset >1 second
    • Investigate VM host time sync conflicts
    • Check for network latency to NTP servers

Source register


Next Steps

  1. Monit — Monitor chronyd and auto-restart if needed
  2. BIND — DNSSEC validation requires accurate time
  3. Authentication — Configure SSO/Kerberos (requires NTP)
  4. SSL Inspection — TLS certificate validation requires accurate time
Related: Supporting Services Overview