Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 am trying to set up sftp access on my server and chroot the users into a samba share. When I edit /etc/ssh/sshd_config and add

Match Group sftpusers
 ChrootDirectory /srv/samba/share
 ForceCommand internal-sftp

I am no longer able to log in. When I try to ssh into the server I get Write failed: Broken pipe and my sftp client says the username and password are not accepted by the server

If I comment out those lines I am able to log in via ssh and sftp again.

/srv/samba/ is rwxr-xr-x root root

/srv/samba/share is rwxrwxr-x root sftpusers

Anyone know what I can do to solve this?

share|improve this question

ChrootDirectory /srv/samba/share should have been ChrootDirectory /srv/samba

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.