]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/mac_ntpd.4
Remove deprecated GEOM classes
[FreeBSD/FreeBSD.git] / share / man / man4 / mac_ntpd.4
1 .\" Copyright (c) 2018 Ian Lepore <ian@FreeBSD.org>
2 .\"
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
5 .\" are met:
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\"    notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\"    notice, this list of conditions and the following disclaimer in the
10 .\"    documentation and/or other materials provided with the distribution.
11 .\"
12 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
13 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
16 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22 .\" SUCH DAMAGE.
23 .\"
24 .\" $FreeBSD$
25 .\"
26 .Dd July 20, 2018
27 .Dt MAC_NTPD 4
28 .Os
29 .Sh NAME
30 .Nm mac_ntpd
31 .Nd "policy allowing ntpd to run as non-root user"
32 .Sh SYNOPSIS
33 To compile the ntpd policy into your kernel, place the following lines
34 in your kernel configuration file:
35 .Bd -ragged -offset indent
36 .Cd "options MAC"
37 .Cd "options MAC_NTPD"
38 .Ed
39 .Pp
40 Alternately, to load the ntpd policy module at boot time,
41 place the following line in your kernel configuration file:
42 .Bd -ragged -offset indent
43 .Cd "options MAC"
44 .Ed
45 .Pp
46 and in
47 .Xr loader.conf 5 :
48 .Bd -literal -offset indent
49 mac_ntpd_load="YES"
50 .Ed
51 .Sh DESCRIPTION
52 The
53 .Nm
54 policy grants any process running as user
55 .Sq ntpd
56 (uid 123) the privileges needed to manipulate
57 system time, and to (re-)bind to the privileged NTP port.
58 .Pp
59 When
60 .Xr ntpd 8
61 is started with
62 .Sq Fl u Ar <user>[:group]
63 on the command line, it performs all initializations requiring root
64 privileges, then drops root privileges by switching to the given user id.
65 From that point on, the only privileges it requires are the ability
66 to manipulate system time, and the ability to re-bind a UDP socket
67 to the NTP port (port 123) after a network interface change.
68 .Pp
69 With the
70 .Nm
71 policy active, it may also be possible to start ntpd as a non-root user,
72 because the default ntpd options don't require any additional root
73 privileges beyond those granted by the policy.
74 .Pp
75 .Ss Privileges Granted
76 The exact set of kernel privileges granted to any process running
77 with the configured uid is:
78 .Bl -inset -compact -offset indent
79 .It Dv PRIV_ADJTIME
80 .It Dv PRIV_CLOCK_SETTIME
81 .It Dv PRIV_NTP_ADJTIME
82 .It Dv PRIV_NETINET_RESERVEDPORT
83 .It Dv PRIV_NETINET_REUSEPORT
84 .El
85 .Pp
86 .Ss Runtime Configuration
87 The following
88 .Xr sysctl 8
89 MIBs are available for fine-tuning this MAC policy.
90 All
91 .Xr sysctl 8
92 variables can also be set as
93 .Xr loader 8
94 tunables in
95 .Xr loader.conf 5 .
96 .Bl -tag -width indent
97 .It Va security.mac.ntpd.enabled
98 Enable the
99 .Nm
100 policy.
101 (Default: 1).
102 .It Va security.mac.ntpd.uid
103 The numeric uid of the ntpd user.
104 (Default: 123).
105 .El
106 .Sh SEE ALSO
107 .Xr mac 4 ,
108 .Xr ntpd 8
109 .Sh HISTORY
110 MAC first appeared in
111 .Fx 5.0
112 and
113 .Nm
114 first appeared in
115 .Fx 12.0 .