# SFTP - 'bad ownership or modes for chroot directory'



## bogdansolga (Nov 14, 2013)

Hello!

I am working on setting up a SFTP server using the sshd configuration (from /etc/ssh/sshd_config):

```
#SSH/SFTP group
Match Group sftpusers
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
```
I created a few users in the sftpusers group and configured the correct chown and chmod for them, but there is a problem which I couldn't fix, so far - when the user logs in (via a SFTP client), s/he cannot create files/folders in his/her home folder. If a folder is created by the root user and write permissions are granted to it, the user (owner) can then write to that folder, though.

Is there any way in which the user could create folders/files in his/her folder? Any help is greatly appreciated.

Perhaps the issue is better described here - https://wiki.archlinux.org/index.php/SFTP-chroot#Write_access_to_chroot_dir

Disclaimer: I am a newcomer in the FreeBSD world, and I love it so far. I have searched for a previous reference to this problem in the FreeBSD forums, but I couldn't find a related post.

Regards,
Bogdan


----------

