Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I added the below to sshd_config, when i chmod 770 the user folder i get this error? Why? how can i make the folder only readable to the user or group? the owner currently is root and the group is currently that username

fatal: bad ownership or modes for chroot directory

-edit- this is for a user to sftp to store files. Only that user or that group should access that folder. i dont understand why i cant change the permission from 755 to 775 either. Adding write permission gives me an error when i try to log in as the user.


Match group SomeGroup
         ChrootDirectory /mnt/somedir/%u
         X11Forwarding no
         AllowTcpForwarding no
         ForceCommand internal-sftp
share|improve this question
There is no need to have write permission for user (or in this case user group). Actually, it's pretty bad idea, because otherwise user is able to modify files in that directory. – Olli Apr 2 '11 at 19:49
@Olli: Well, its his storage... he should be able to modify all the files he wants... and no one else should see it – acidzombie24 Apr 2 '11 at 20:18

From the sshd_config(5) man page:

         Specifies a path to chroot(2) to after authentication.  This
         path, and all its components, must be root-owned directories that
         are not writable by any other user or group.

You need to turn off the group-write bit.

share|improve this answer
how do i do that? – acidzombie24 Apr 3 '11 at 0:42
You want the permissions to be 750, and the user should be a member of the group. For more details, see – justarobert Apr 3 '11 at 5:47

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.