MAC_NTPD(4)
π MAC_NTPD(4) β the manual page, but make it make sense π¦
okay so bestie, welcome to the mac_ntpd(4) page from the Kernel Interfaces Manual β yes, that's the manual name, and this is the policy that lets ntpd run as a non-root user. no cap, this is the whole vibe check. β¨
πΈ NAME πΈ
mac_ntpd β policy allowing ntpd to run as non-root user.
β¨ SYNOPSIS β¨
To compile the ntpd policy into your kernel, place the following lines in your kernel configuration file:
options MAC
options MAC_NTPD
Alternately, to load the ntpd policy module at boot time, place the following line in your kernel configuration file:
options MAC
and in loader.conf(5):
mac_ntpd_load="YES"
π DESCRIPTION π
The mac_ntpd policy grants any process running as user ntpd (uid 123) the privileges needed to manipulate system time, and to (re-)bind to the privileged NTP port.
When ntpd(8) is started with -u <user>[:group] on the command line, it performs all initializations requiring root privileges, then drops root privileges by switching to the given user id. From that point on, the only privileges it requires are the ability to manipulate system time, and the ability to re-bind a UDP socket to the NTP port (port 123) after a network interface change.
With the mac_ntpd policy active, it may also be possible to start ntpd as a non-root user, because the default ntpd options don't require any additional root privileges beyond those granted by the policy.
π Privileges Granted π
The exact set of kernel privileges granted to any process running with the configured uid is:
PRIV_ADJTIME
PRIV_CLOCK_SETTIME
PRIV_NTP_ADJTIME
PRIV_NETINET_RESERVEDPORT
PRIV_NETINET_REUSEPORT
π Runtime Configuration π
The following sysctl(8) MIBs are available for fine-tuning this MAC policy. All sysctl(8) variables can also be set as loader(8) tunables in loader.conf(5).
security.mac.ntpd.enabledβ Enable themac_ntpdpolicy. (Default: 1).security.mac.ntpd.uidβ The numeric uid of thentpduser. (Default: 123).
π SEE ALSO π
π¦ HISTORY π¦
MAC first appeared in FreeBSD 5.0 and mac_ntpd first appeared in FreeBSD 12.0.
mwah π source/version: Debian, dated July 20, 2018 β catch you in the kernel, bestie π«Ά
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2018 Ian Lepore <ian@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms