HomePage » Linux » LinuxSecurity

chroot and ssh

Download and install jail from http://www.jmcresearch.com/projects/jail/howto.html
tar zxvf jail_1.9a.tar.gz
cd jail/src
# make changes to Makefile, specifically platform and install location. Default is Linux and /usr/local/bin
make
make install


Now create the jail environment
mkjailenv /var/chroot


Add basic programs
addjailsw /var/chroot
# The following file is not copied to chroot root, which is required by bash
cp /lib/ld-linux.so.2 (0x00b69000) /var/chroot/lib


Add other programs to chroot environment
addjailsw /var/chroot -P awk 


Now add users, first add local user, then add jail user.
useradd -d /var/chroot -s /usr/local/bin/jail prisioner
addjailuser /var/chroot /home/prisioner /bin/bash prisioner

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki