2

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. 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. 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.

  • 1
    just a remark ssh (and sftp) have nothing to do with vsftpd who have a configuration of its onw (/etc/vsftpd/vsftpd.conf) – Archemar Sep 19 '15 at 14:17
  • Do you want some sense of security with an unencrypted FTP? Is it in some SOHO LAN, or? – Incnis Mrsi Sep 19 '15 at 14:24
  • It is a Ubuntu VPS, security can be left out if the thing works. – Shikhar Baheti Sep 19 '15 at 14:49
0

Change ChrootDirectory /home/shooter/shooter/mods to ChrootDirectory %h doing so you can restrict users of that groups to their home directory.

Subsystem sftp internal-sftp
Match group shooter
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp

Follow this for write issue sftp_with_write_issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.