sftp limit user to directory

0

1

I need to limit sftp for a user to a certain folder.

So far I have followed this tutorial to the letter:

http://shapeshed.com/chroot_sftp_users_on_ubuntu_intrepid/

It works in the sense that I can log in with the users details but it appears this user can go up in the hierarchy to other folders.

Are there other permission to be set to prevent access to other folders?

Also this user can browse all other folders but has no write/delete access to any folder even the one he is supposed to have access to.

Stofke

Posted 2013-01-18T13:45:08.137

Reputation: 156

Answers

0

I just ommited the last step of that tutorial

chown root:root theirsite.com

If I leave that off that part, the new user can write to that directory. So the writing issue seems to be solved. He can't write to any other directory above so that's also great.

The only problem left is that he can still browse up the tree. I don't want this user to see other content or sites on the server.

Stofke

Posted 2013-01-18T13:45:08.137

Reputation: 156

0

Here's some documentation if you're using OpenSSH. OpenSSH SFTP chroot() with ChrootDirectory. With that you can define which folders sftp-users are allowed to see.

Kride

Posted 2013-01-18T13:45:08.137

Reputation: 1 079

Link-only answer is considered low quality; it will be useless if the target site moves or vanishes. Please cite the relevant part of the solution here. – Kamil Maciorowski – 2018-08-29T18:26:48.613