1.\" Copyright (c) 2003 Networks Associates Technology, Inc.
2.\" All rights reserved.
3.\"
4.\" Portions of this software were developed for the FreeBSD Project by
5.\" ThinkSec AS and NAI Labs, the Security Research Division of Network
6.\" Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
7.\" ("CBOSS"), as part of the DARPA CHATS research program.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. The name of the author may not be used to endorse or promote
18.\"    products derived from this software without specific prior written
19.\"    permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.Dd February 10, 2003
34.Dt PAM_CHROOT 8
35.Os
36.Sh NAME
37.Nm pam_chroot
38.Nd Chroot PAM module
39.Sh SYNOPSIS
40.Op Ar service-name
41.Ar module-type
42.Ar control-flag
43.Pa pam_chroot
44.Op Ar arguments
45.Sh DESCRIPTION
46The chroot service module for PAM chroots users into either a
47predetermined directory or one derived from their home directory.
48If a user's home directory as specified in the
49.Vt passwd
50structure returned by
51.Xr getpwnam 3
52contains the string
53.Dq Li /./ ,
54the portion of the directory name to the left of that string is used
55as the chroot directory, and the portion to the right will be the
56current working directory inside the chroot tree.
57Otherwise, the directories specified by the
58.Cm dir
59and
60.Cm cwd
61options (see below) are used.
62.Bl -tag -width ".Cm also_root"
63.It Cm also_root
64Do not hold user ID 0 exempt from the chroot requirement.
65.It Cm always
66Report a failure if a chroot directory could not be derived from the
67user's home directory, and the
68.Cm dir
69option was not specified.
70.It Cm cwd Ns = Ns Ar directory
71Specify the directory to
72.Xr chdir 2
73into after a successful
74.Xr chroot 2
75call.
76.It Cm dir Ns = Ns Ar directory
77Specify the chroot directory to use if one could not be derived from
78the user's home directory.
79.El
80.Sh SEE ALSO
81.Xr pam.conf 5 ,
82.Xr pam 3
83.Sh AUTHORS
84The
85.Nm
86module and this manual page were developed for the
87.Fx
88Project by
89ThinkSec AS and NAI Labs, the Security Research Division of Network
90Associates, Inc.\& under DARPA/SPAWAR contract N66001-01-C-8035
91.Pq Dq CBOSS ,
92as part of the DARPA CHATS research program.
93