we have a few users that upload directly to the server. Now we want to implement a new system where we use a common PC for all uploads. We already created separate user accounts for all users in that PC, and created SSH key based login to the server. So now, users can login via ssh/sftp to their respective user accounts in main PC and then do all the uploading to the server. Now the problem is, we want to give full access to only 2 users, and restrict all other users from accessing anything other than /var/www/html.

1 Answer 1


Create a group for the users how should have full acces:

$ sudo groupadd full_access
$ sudo chown -R :full_access /path/to/special/data/
$ sudo usermod -a -G full_access username

Don't do something like "sudo chown -R :www_full_access /"! This will break your system. If you need user with root-access to your system, add them to the sudoers group:

$ sudo usermod -a -G sudo username
  • Without -a, usermod -G will remove the user from any current groups.
    – muru
    Jun 7, 2017 at 8:11
  • @muru Good point! Jun 7, 2017 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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