OpenSSH (GNU/Linux) chroot patch for openssh-5.2p1
To chroot a SSH session into ~/ by using /./ in homedir path
example:
~# useradd -d /home/sn00p/./ sn00p
~# cat /etc/passwd | grep sn00p
sn00p:x:10000:10000::/home/sn00p/./:/bin/bash
download & unpack the source:
~# cd /usr/src
~# wget ftp://mirror.switch.ch/pub/OpenBSD/OpenSSH/portable/openssh-5.2p1.tar.gz
~# tar zxf openssh-5.2p1.tar.gz
download patch & apply to source:
~# cd /usr/src/openssh-5.2p1
~# wget http://www.cybnet.ch/misc/openssh-5.2p1-chroot.patch
~# patch -p0 < openssh-5.2p1-chroot.patch
configure & compile:
~# ./configure --your-options
~# make
Original patch by Ricardo Cerqueira <rmcc@clix.pt>
Updated for OpenSSH 5 by Mike Mueller <mike@cybnet.ch>