1/23
Looks like no tags are added yet.
S1's auth log shows a failed SSH attempt at 14:32. S2's log shows the same source connecting at 14:28. Are these related?
you cannot tell unless the clocks agree
What does timedatectl show?
shows both, the time zone, and whether a synchroniser is active
How would you set the timezone to Winnipeg?
timedatectl set-timezone America/Winnipeg
What can a full NTP implementation do compared to a small one?
A full NTP implementation can serve time and discipline the clock accurately: classic ntpd, chrony and NTPsec, a security-hardened, much smaller fork of ntpd that adds Network Time Security (NTS) for authenticated time.
A small SNTP client that steps or slews the clock and cannot serve time, such as systemd-timesyncd (Ubuntu's default)
What is the configuration of NTPsec?
/etc/ntpsec/ntp.conf
What is the difference between NTPsec and classic ntpd?
NTPsec is stricter than classic ntpd, so a directive copied from an older tutorial may be rejected or silently ignored
On Ubuntu Server, what does installing ntpsec do?
installing ntpsec removes the systemd-timesyncd package for you (both provide time-daemon, and apt lists the removal): check with dpkg -l systemd-timesyncd and sudo ss -ulnp | grep 123.
What does timedatectl timesync-status do?
shows the server and stratum it uses
What does pool do?
expands to several servers (resilient) versus a fixed server
What does iburst do?
speeds the first sync
What does driftfile do?
remembers the clock's error
Why is query access is kept tight?
Historically open NTP servers answering monitoring queries were abused for amplification attacks
What is restrict?
restrict is an access list for the NTP service. Lines match by address and mask, the most specific match wins, and flags allow or deny actions: serving time, answering ntpq queries, being modified, being used as a peer. A default that denies everything plus specific permits for your clients is the safest shape; sources you sync from need to be allowed to reply. The NTPsec man page for the configuration file lists the flags it supports
What does the tally code * mean?
selected
What does the tally code + mean?
candidate
What does the tally code -/x mean?
rejected
When does a synchronised server shows a *?
Within minutes
How do you interpret ntpq -p?
the show ntp associations of Linux: remote with a tally code (* selected, + candidate, -/x rejected), refid (the source's own upstream), st stratum, t type, when, poll, reach (an octal register of the last eight polls: 377 means all succeeded), then delay, offset and jitter
What is the likely cause and fix for the following issue: Edited /etc/ntp.conf but nothing changed
On 24.04 NTPsec reads /etc/ntpsec/ntp.conf
Edit the NTPsec file and restart the ntpsec service
What is the likely cause and fix for the following issue: NTPsec will not start: address already in use
another time daemon owns UDP 123 (the ntpsec install removes timesyncd on Server)
sudo ss -ulnp | grep 123 shows the owner; stop and remove or disable it
What is the likely cause and fix for the following issue: ntpq -p never shows a *
Outbound UDP 123 blocked, a restrict line blocks the upstream replies, or not enough time has passed
Wait a few minutes; check the journal; capture on eth1 to see whether replies return
What is the likely cause and fix for the following issue: S2 still shows an old server or stratum
timesyncd drop-in not read, or not restarted
Restart systemd-timesyncd; confirm with timedatectl timesync-status
What is the likely cause and fix for the following issue: S2 stops syncing after the restrict change
The policy blocks S2's address, or ignores everything including replies
Allow S2's address and the upstream sources; restart and recheck with ntpq and the journal
What is the likely cause and fix for the following issue: The host is still served after restricting to S2
A broader line (the whole LAN) still matches, or the old policy is still loaded
Review the lines for the most specific match; restart ntpsec