William Shallum

Jailkit Usage

Posted Oct 7 2011, 16:53 by William Shallum [updated Oct 7 2011, 16:57]

jailkit: http://olivier.sessink.nl/jailkit/

Create chroot directory

mkdir /chroot/foo
chown root:root /chroot/foo

Add sets

jk_init -j /chroot/foo <sets>

Possible sets: see /etc/jailkit/jk_init.ini

Possibly useful: jk_lsh, basicshell, if not even basicshell: uidbasics, netbasics, logbasics

Move users

jk_jailuser -j /chroot/foo <users>

This will update /etc/passwd and set the users’ shells to jk_chrootsh

Possible options: -m move homedir instead of copying

Copy more stuff

jk_cp -j /chroot/foo <files/directories>

This will copy any executables with the dependencies.

Possible options: -k hardlink instead of copying, -f force overwrite of stuff, -o retain ownership & permissions


do not: su - <jaileduser>

do: su <jaileduser>