]> git.cameronkatri.com Git - apple_cmds.git/blob - shell_cmds/chroot/chroot.8
Merge branch 'apple'
[apple_cmds.git] / shell_cmds / chroot / chroot.8
1 .\" Copyright (c) 1988, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" from: @(#)chroot.8 8.1 (Berkeley) 6/9/93
33 .\" $NetBSD: chroot.8,v 1.7 1998/10/06 03:47:50 mrg Exp $
34 .\"
35 .Dd October 6, 1998
36 .Dt CHROOT 8
37 .Os BSD 4.3
38 .Sh NAME
39 .Nm chroot
40 .Nd change root directory
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl u user
44 .Op Fl g group
45 .Op Fl G group,group,...
46 .Ar newroot
47 .Op Ar command
48 .Sh DESCRIPTION
49 The
50 .Nm
51 command changes its root directory to the supplied directory
52 .Ar newroot
53 and exec's
54 .Ar command ,
55 if supplied, or an interactive copy of your shell.
56 .Pp
57 If the
58 .Fl u ,
59 .Fl g
60 or
61 .Fl G
62 options are given, the user, group and group list of the process are
63 set to these values after the chroot has taken place. See
64 .Xr setgid 2 ,
65 .Xr setgroups 2 ,
66 .Xr setuid 2 ,
67 .Xr getgrnam 3
68 and
69 .Xr getpwnam 3 .
70 .Pp
71 Note,
72 .Ar command
73 or the shell are run as your real-user-id.
74 .Sh ENVIRONMENT
75 The following environment variable is referenced by
76 .Nm :
77 .Bl -tag -width SHELL
78 .It Ev SHELL
79 If set,
80 the string specified by
81 .Ev SHELL
82 is interpreted as the name of
83 the shell to exec.
84 If the variable
85 .Ev SHELL
86 is not set,
87 .Pa /bin/sh
88 is used.
89 .El
90 .Sh SEE ALSO
91 .Xr chdir 2 ,
92 .Xr chroot 2 ,
93 .Xr environ 7
94 .Sh HISTORY
95 The
96 .Nm
97 utility first appeared in
98 .Bx 4.4 .
99 .Sh SECURITY CONSIDERATIONS
100 .Nm
101 should never be installed setuid root, as it would then be possible
102 to exploit the program to gain root privileges.