Is there any way to limit users to certain home directories with sftp and cygwin:

For example user1 cannot get out of




I don't think there is on windows but maybe I am wrong.

Failing that is there anyway to only let user's get directory listings and upload files only? I am trying to avoid users being able to access each other's files.




You should read the sshd_config man page: man sshd_config.

It seems that you want the ChrootDirectory option in /etc/sshd_config:

ChrootDirectory %h

If you only want the restriction to apply to some users, then you should precede the above with

Match User user1,user2,...

None of the above is specific to Cygwin, but you should test it on Cygwin to be sure that it works as desired there. I haven't used the ChrootDirectory option myself, so you should check to be sure it's implemented in Cygwin.

  • I've done that but I get "connection closed" whenever I have the ChrootDirectory set. It is not much to go on. – dagda1 Nov 30 '11 at 12:40
  • If you're using public key authentication, try using password authentication instead. There are limitations on pubkey authentication in Cygwin that might be causing that. – Andrew Schulman Nov 30 '11 at 14:41
  • This answer actually fixed the problem serverfault.com/a/201879/65157. Copssh makes it a bit easier to administer. – dagda1 Dec 1 '11 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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