Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I confine my users to their /home/%u directory using simply open-ssh configuration? I did the following from what I found on the Internet Stopped the server To the sshd_config file appended the following

Match group sftpusers
    ChrootDirectory /home/%u
    X11Forwarding no
    AllowTcpForwarding no

started the server

FYI I have the users added to sftpusers group

My users can still access entire file structure on my system

Ubuntu Server 12.04 LTS with open-ssh installed

share|improve this question
Is this only for sftp, or do they also need shell access? – Zoredache Oct 4 '12 at 19:54

I'm using this on OpenSSH_5.3p1 and it's working:

Subsystem sftp internal-sftp
Match group sftponly
         ChrootDirectory %h
         X11Forwarding no
         AllowTcpForwarding yes
         ForceCommand internal-sftp
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.