Here the example for ssh:jail_small

SSH

apt-get install sudo debianutils coreutils
get the script that does a lot of configuration for us
cd /usr/local/sbin
wget http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/make_chroot_jail.sh
chmod 700 /usr/local/sbin/make_chroot_jail.sh

take a look if the script contains all APPS you need

vi /usr/local/sbin/make_chroot_jail.sh

create symlink back to home

cd /home
ln -s . home

create jailshell

make_chroot_jail.sh heinzi /bin/bash /home

config /etc/ssh/sshd_config

vi /etc/ssh/sshd_config

add at end of file

user
Match User heinzi
ChrootDirectory /home
AllowTCPForwarding no
X11Forwarding no
group

Match Group users

  ChrootDirectory /home
AllowTCPForwarding no
X11Forwarding no

restart ssh

/etc/init.d/ssh restart