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.