Debian Codegraph @

upstream/mageia-cauldron/man8/pam_chroot.8

raw
1 '\" t
2 .\" Title: pam_chroot
3 .\" Author: [see the "AUTHOR" section]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
5 .\" Date: 01/25/2026
6 .\" Manual: pam-redhat Manual
7 .\" Source: pam-redhat
8 .\" Language: English
9 .\"
10 .TH "PAM_CHROOT" "8" "01/25/2026" "pam\-redhat" "pam\-redhat Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 pam_chroot \- PAM module that allows a user to be chrooted in session
32 .SH "SYNOPSIS"
33 .HP \w'\fBpam_chroot\&.so\fR\ 'u
34 \fBpam_chroot\&.so\fR [debug] [onerr]
35 .SH "DESCRIPTION"
36 .PP
37 When the calling application attempts to open a session, pam_chroot opens
38 /etc/security/chroot\&.conf
39 and searches for a line of the form: user directory, where the "user" listed is actually a regular expression\&. If the
40 \fIPAM_USER\fR
41 for whom the session is being opened matches the regular expression, the module will attempt to chroot() to the given directory\&.
42 .PP
43 The calling application must be executing with root privileges in order to be able to chroot() at all\&. If the application needs to exec() other programs (such as a server process or spawning a shell), you will need to duplicate some portions of an actual root environment under the chroot()ed directory in order for it to work at all\&. (This includes configuration and logging files\&.) If configured incorrectly, this module may potentially render the service unusable and, under some circumstances, pose a security risk\&.
44 .PP
45 In particular, the new root directory and all of its parent directories must not be writable by anyone but root\&.
46 .SH "OPTIONS"
47 .PP
48 debug
49 .RS 4
50 Log debug messages to syslog\&.
51 .RE
52 .PP
53 onerr=
54 .RS 4
55 Values can be
56 \fI"succeed"\fR
57 or
58 \fI"fail"\fR\&. The action to take if the configuration file can not be opened, the chroot() fails, or the user does not match any of the expressions listed in the configuration file\&. Default is
59 \fI"succeed"\fR\&.
60 .RE
61 .SH "MODULE TYPES PROVIDED"
62 .PP
63 Only
64 \fBsession\fR
65 module type is provided\&.
66 .SH "RETURN VALUES"
67 .PP
68 .PP
69 PAM_SUCCESS
70 .RS 4
71 Everything was successful\&.
72 .RE
73 .PP
74 PAM_SESSION_ERR
75 .RS 4
76 Session error\&.
77 .RE
78 .SH "FILES"
79 .PP
80 /etc/security/chroot\&.conf
81 .RS 4
82 Chroot configuration file
83 .RE
84 .SH "SEE ALSO"
85 .PP
86 \fBpam.d\fR(5),
87 \fBpam\fR(8)
88 .SH "AUTHOR"
89 .PP
90 The original pam_chroot was written by Matthew Kirkwood and it was obtained from ftp://ferret\&.lmh\&.ox\&.ac\&.uk/users/weejock/pam_chroot/\&.
91 .PP
92 nalin ported this module for Red Hat\&.