| 1 |
|
| 2 |
This is a sample configuration for the pam_chroot module. |
| 3 |
|
| 4 |
In order to make this work you need to: |
| 5 |
|
| 6 |
1.- use setup-chrootdir.sh to create a directory in which |
| 7 |
the user will be chrooted (let's call it CHROOTDIR) |
| 8 |
A sample layout like the one it creates is provided in the |
| 9 |
chrooted-directory-tree.txt file |
| 10 |
|
| 11 |
WARNING! Make sure to have an open console in which to |
| 12 |
become superuser in case you mangle the files and cannot |
| 13 |
log-on to the system later on! |
| 14 |
|
| 15 |
2.- configure /etc/security/chroot.conf so that a given user |
| 16 |
(USERCHROOTED) is chrooted to CHROOTDIR when entering (in the |
| 17 |
sample configuration file CHROOTDIR=/chroot/directory) |
| 18 |
|
| 19 |
3.- add the following line to /etc/pam.d/login |
| 20 |
session required pam_chroot.so debug |
| 21 |
|
| 22 |
4.- create USERCHROOTED in the system (/etc/passwd et al.) and |
| 23 |
have his home directory be /home/test |
| 24 |
(real directory=CHROOTDIR/home/test) |
| 25 |
|
| 26 |
5.- add the neccesary .profile, .cshrc, .bash_profile files to |
| 27 |
the CHROOTDIR/home/test directory (fix permissions to your own |
| 28 |
needs/policy) |
| 29 |
|
| 30 |
6.- Try to enter the system as USERCHROOTED. You should be |
| 31 |
restricted to CHROOTDIR and have only a limited number of |
| 32 |
utilies (setup-chrootdir only provides 'ls') |
| 33 |
|
| 34 |
If it does not work check the syslog files to see the messages |
| 35 |
related to PAM (should include pam_chroot[XXXX]: session messages |
| 36 |
due to the 'debug' option being set) |