Restrict SFTP users to different directories
2
votes
1
answer
2860
views
How can I restrict some users/groups to some directories? I mean different users, different directories.
- What I have: Ubuntu 14.
- Experience with Ubuntu: Just started.
What I have tried:
1. I read [this page](https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-on-ubuntu-12-04) . This was working till a bit extent, what the problem is that, the user can do things only in his folder/directory, which is read/write and edit, but the user can also go elsewhere, and open files and copy scripts from there, which can be risky as while having a game server on the VPS. He can't delete/edit or add files but can VIEW files other than his directory.
2. And, then [this page](http://www.krizna.com/ubuntu/setup-ftp-server-on-ubuntu-14-04-vsftpd/) . This worked fine, but the problem is, I couldn't find a way to add more users to different directories. Like, I could only add one user to directory which was specified in sshd_config file. There is only one directory which can be restricted for one group. I want it to be flexible, able to add different users to different directories... groups.
Here is what I'm talking about:
sshd_config
Subsystem sftp internal-sftp
Match group shooter
ChrootDirectory /home/shooter/shooter/mods
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
That shooter
group can only access that ChrootDirectory
. If I add different users to that group, they'll be able to view only that path. I want other users to view other directories, how is that possible?
Please help me, It's really important for me, as I've many game-servers to handle on a VPS, working with different developers.
Asked by Shikhar Baheti
(21 rep)
Sep 19, 2015, 01:06 PM
Last activity: Nov 25, 2021, 06:00 PM
Last activity: Nov 25, 2021, 06:00 PM