The Rub

AUTOMATICALLY SIMPLE SINCE 2002

Minimal SSH Chroot in FreeBSD

pw useradd gimpy -d /usr/local/gimpy -s /bin/sh
passwd gimpy # enter password
mkdir /usr/local/gimpy
chown root:gimpy /usr/local/gimpy # root must own the chroot directory
mkdir /usr/local/gimpy/bin
cp /rescue/sh /usr/local/gimpy/bin/
# at the bottom of /etc/ssh/sshd_config:
        Match User gimpy
                ChrootDirectory /usr/local/gimpy
                X11Forwarding no
                AllowTcpForwarding no
/etc/rc.d/sshd reload