NTS with chrony
Plain NTP has no protection: anyone between your server and the time server could send false times. Network Time Security (NTS, RFC 8915) fixes that by authenticating every answer. With chrony it takes one word per server.
What you need
- chrony 4.0 or newer, built with NTS. Check with
chronyd --version: the list of features should include+NTS. Current versions of Debian, Ubuntu, Fedora, RHEL and its relatives qualify. - Outgoing TCP port 4460 (for the NTS key exchange, which uses TLS) as well as the usual UDP port 123.
- Servers that support NTS. Not all do; the ones below are public and in Europe, or anycast.
Configuration
Edit /etc/chrony/chrony.conf (Debian, Ubuntu) or /etc/chrony.conf (Fedora, RHEL, Oracle Linux, Rocky, Alma). Replace the existing server or pool lines with, for example:
server ptbtime1.ptb.de iburst nts server ptbtime2.ptb.de iburst nts server nts.netnod.se iburst nts server time.cloudflare.com iburst nts # Keep NTS keys across restarts, so chrony does not repeat the key exchange ntsdumpdir /var/lib/chrony
Then restart chrony: sudo systemctl restart chronyd (on Debian and Ubuntu the service is called chrony).
Check that it works
chronyc -N authdata chronyc -N sources
In authdata, every server should show NTS in the Mode column and a non-zero number of keys. If a server stays at zero, the key exchange on TCP 4460 is failing: check the firewall and the server name, which must match the server’s certificate. Our NTP server tester also checks whether a server offers NTS.
Good to know
- The certificate check needs a roughly correct clock. A machine that boots with a badly wrong clock (for example, without a working clock battery) can fail the TLS check. chrony’s
nocerttimecheckdirective lets it ignore the certificate’s validity period for the first clock updates; see the chrony documentation before using it. - Mixing NTS and plain NTP servers is possible. Newer chrony versions have an
authselectmodesetting that controls how authenticated and unauthenticated sources are combined. - Some operators use a separate name for NTS, for example Netnod’s
nts.netnod.seor the Croatiannts1.ntp.hr. Use the name given in the list below.