Entri Populer

Tuesday, May 3, 2011

JailKit in Ubuntu

Recently just try to install jail_kit on ubuntu.

i download the package from here,
then extract the package on user home directory.

So far, everyhting works fine but then when i do ./configure, i got error saying that no CC found. Turn out that GCC is not installed, i have the GCC-base installation but not the GCC. So i install the GCC package and the installation went smoothly.

Here is my step :
1. extract the jail_kit package
2. change directory to the jail_kit package
3. ./configure
4. make && make install
5. choose where to create the jail directory, in my case i choose / directory.
6. mkdir jail (or whatever name you choose)
7. chown root:root jail
8. sudo jk_init -v /jail basicshell
sudo jk_init -v /jail editors
sudo jk_init -v /jail jk_lsh
sudo jk_init -v /jail netutils
sudo jk_init -v /jail ssh
sudo jk_init -v /jail sftp
9. adduser testjail
10. passwd testjail qwe32190iuy (choose whatever password you like)
11. sudo jk_jailuser -m -j /jail testjail
12. check your /etc/password and make sure you have the line below
testjail:x:1002:1001:,,,:/jail/./home/testjail:/usr/sbin/jk_chrootsh
13.Enable bash for jailed user
jk_cp -v -f /jail /bin/bash
14.check /jail/etc/passwd and make sure you have the following line
testjail:x:1002:1001::/home/testjail:/bin/bash
15. Also don't forget to make sure that the group exist in /jail/etc/group
testjail:x:1001:

Now test to login and check for error in /var/log/auth.log.


Here are my references:
www.marthijnvandenheuvel.com
ubuntuforums.org