Knowledge for our questions, fun for everyone!
Knowledge for our questions, fun for everyone!
Table of contents
Introduction
How Jail works
Jail internals
Configuring Jail
Setup Entries
Create directories
Adding users
Adding software
Install HOWTO
Download
Top Sections
Libros (160)
Escalada (68)
Outdoor sports (62)
Mountain Bike (58)
Load Balancer (18)
Top project downloads
Jail (20592)
Load Balancer (4084)
eventmonitor (2997)
phptemplater (2478)
Libxml (1447)
Top active projects
Jail (10776)
libnetcomm (10319)
Libxml (9030)
phptemplater (8470)
eventmonitor (7432)
Exits
Jail at Sourceforge
Jail Mailing list
Jail Slashdotted
Jail "Barrapunted"
Jail at Freshmeat
Jail in the WWW
Go back to projects
Poll (101 votes)
What kind of templates you use?
None
String replacements
Smarty
PHPTemplater
Jail internals
How jail interacts with the login process
by Juan M. Casillas

Before configure Jail, we have to need how Jail works. As you can see in the following diagram, the first things that Jail does is get the user's information from the non-chrooted /etc/passwd. In this file there are information about where jail is located (the shell entry of the password file for this user) and which directory will be chrooted (the home directory entry of the password file for this user).

After that, Jail changes to the user directory and then it calls chroot in this directory, creating the chrooted environment. After this call, Jail only can see the files under the chrooted directory. Now, Jail setups some environment variables (the HOME and the SHELL variable that will be used by the real shell).

Now, Jail gets the users' information from the /etc/passwd file in the chrooted environment, and checks if the user home directory is the same that the user home directory information readed from the non-chrooted file. If they are the same, the HOME variable is set to / else, Jail changes to this directory, and changes the HOME variable to this one.

Last, Jail set up again enviroment variables, SHELL is set up with the information readed from the chrooted /etc/passwd file. Now Jail replaces itsef with the shell program stored in the SHELL variable, runing the shell.

Download
Latest version is 1.9a (32.9 Kb, tar.gz file)

 » from JMCResearch
Quick links
Jail Mailing list
Jail install HOWTO
Bug Report
Feature Request
CVS Repository
Local CVS Repository
Ask your questions