]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ntp/html/build/hints/netbsd
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ntp / html / build / hints / netbsd
1 Starting with NetBSD-1.6, it is possible to delegate the system clock 
2 control to a non root user. This enable running ntpd in a chroot 
3 jail under a non privilegied UID/GID, using ntpd -i and -u flags.
4
5 The delegation is done through the clockctl(4) pseudodevice driver. 
6 This driver makes privilegied system calls such as ntp_adjtime(2)
7 available through ioctl(2) on the /dev/clockctl device. If a user
8 is able to write to /dev/clockctl, then (s)he can control the system 
9 clock.
10
11 In order to use this feature, make sure that:
12
13 1) Your kernel is compiled with the following option:
14 pseudo-device   clockctl
15 This is true for GENERIC kernels on most ports. Please check 
16 http://wwW.netbsd.org/Documentation/kernel/
17 if you need information about building a kernel.
18
19 2) You have a ntpd user on your system. Here is the /etc/master.passwd
20 entry for ntpd user on NetBSD-1.6:
21 ntpd:*:15:15::0:0:& pseudo-user:/var/chroot/ntpd:/sbin/nologin
22 And here is the /etc/group entry for group 15:
23 ntpd:*:15:
24
25 3) /dev/clockctl exists and is writtable by user ntpd. Default 
26 NetBSD-1.6 setting is:
27 crw-rw----  1 root  ntpd  61, 0 Apr 1  2002 /dev/clockctl
28 Major device number and date is likely to be different on your system.
29 If you need to create the device, issue the following command:
30 cd /dev && ./MAKEDEV clockctl
31
32 Here is an example of how to run ntpd chrooted in /var/chroot/ntpd, 
33 running with ntpd UID and ntpd GID:
34 ntpd -i /var/chroot/ntpd -u ntpd:ntpd
35 Note that -i and -u options are enabled at configure time if your 
36 system supports system clock control by an unprivilegied user. If this
37 is not the case, then the -i and -u options will not be available.