Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

For example user1 cannot get out of

/home/user1/

User2

/home/user2/

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.

Thanks

Paul

share|improve this question

1 Answer 1

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

Your Answer

 
discard

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.