2

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

dagda1
  • 237
  • 3
  • 6
  • 19

1 Answers1

1

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.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
  • 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 http://serverfault.com/a/201879/65157. Copssh makes it a bit easier to administer. – dagda1 Dec 01 '11 at 10:57