Originally Posted by
rduke15
Is it possible to restrict commands to specific paths?
I am looking for a way to allow users to chown and chmod certain files and directories, IF they are under a specific directory.
For example:
Code:
sudo chown -R -c :webmasters /docs/www
should be allowed. But NOT other directories like
Code:
sudo chown -R -c :users /etc
Is this possible with sudo?
Thanks.
If I understand you correctly, I think this outside of the scope of what sudo can do. So I would have to say that no this is not possible using sudo.
To answer your problem, though, I would use Linux ACL (Access Control Lists) to do that sort of thing.
With access control lists, you can set permissions of files and directories on a "per user" or "per group" basis.
To implement it into your system, add "acl" to fstab, so it may look like the following:
Code:
UUID=b3d3d8f2 / ext4 relatime,errors=remount-ro,acl 0 1
Then remount the partition:
Code:
sudo mount -o remount /
A simple application to set such permissions is eiciel
Code:
sudo apt-get install eiciel
If setup correctly, you do not need to use sudo to carry out what you want to do.
Regards
Iain
Bookmarks