Take the 2-minute tour ×

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.



share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
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
add comment

Your Answer


