select * from sectionselect * from sectionselect * from section JMC Research - Juan M. Casillas Web Site
Knowledge for our questions, fun for everyone!

http://www.jmcresearch.com/src/articlehelper.php?id=6
Printed at 27/04/2024 00:50:08
http://www.jmcresearch.com Knowledge for our questions, fun for everyone!
Configuring Jail entries
The non-chrooted /etc/passwd file

Published at 26/08/2003 17:10:48
By Juan M. Casillas

To build the user's password entries we can use a user creation script (just one like adduser) or to add the entries by hand. I usually prefer the second way, but first is also fine. If you choose the first method, when the creation scripts ends its work, you have to edit the files by hand. Here, I will use the second. Our nick name for the test user used in the examples will be user3.

All the magic resides on the /etc/passwd file. We have to add a line in this file to create a user in this machine. You have to setup also /etc/group and /etc/shadow if you have shadow passwords installed. Note also that you have to fit the uid an gid fields password, etc.

  user3:x:101:101:Jail Test User:/var/chroot:/usr/local/bin/jail

Note the /var/chroot field. This is the root directory of the chroot environment for this user.


http://www.jmcresearch.com Knowledge for our questions, fun for everyone!