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=8
Printed at 16/05/2024 05:12:43
http://www.jmcresearch.com Knowledge for our questions, fun for everyone!
Adding users to the Jail
Or how to invoke addjailuser

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

addjailuser edit the chrooted /etc/passwd automatically, creates the user directories, addjailuser has been written in perl script. This are the command line arguments:

addjailuser chrootdir userdir usershell username
Argument Description
chrootdir The directory where the chrooted environment will live. It its the home entry in the non-chrooted /etc/passwd file
userdir The directory inside the chrooted enviroment when the user will live, in our example, /home/user3.
usershell The user?s shell full path (e.g. /bin/bash)
username The user?s name. In our example, user3

Invocation example:

addjailuser /var/chroot /home/user3 /bin/bash user3

This will add a user under the directory /var/chroot setups the home directory of the user3 into /home/user3, and selects /bin/bash as default shell for user3. Also edits the chrooted /etc/passwd, /etc/group and /etc/shadow to configure propertly jail.


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