Chroot SFTP home dir

Example user ‘iain’

sudo mkdir -p /chroot/iain/home/iain
sudo useradd -M -d /home/iain iain
sudo passwd iain
sudo chwon iain: /chroot/iain/home/iain

sudo nano -w /etc/ssh/sshd_config
# At the end of the file, add:

Match User paypoint
    ChrootDirectory /chroot/iain
    AllowTCPForwarding no
    X11Forwarding no
    ForceCommand internal-sftp

sudo /etc/init.d/ssh restart

You can leave a response, or trackback from your own site.

Leave a Reply