Chroot Sftp

Sun, May 3, 2009

Linux

  1. Create a Chrooted group
    addgroup chrooted
  2. Open up /etc/ssh/sshd_config and add the following to the end of it
    Subsystem sftp internal-sftp
    Match group chrooted
    ChrootDirectory /home/%u
    X11Forwarding no
    ForceCommand internal-sftp
    
  3. Restart SSHD
    /etc/init.d/ssh restart
  4. Then make users chrooted by adding them to the chrooted group
    adduser user chrooted
  5. Now when the user sftps the server they will only see the contents of there home folder
, , , , , ,

This post was written by:

- who has written 47 posts on Tuts4Tech.

I am the owner of this website, please feel free to ask me any questions you have

Contact the author

Leave a Reply