Allow users to chmod certain directories via sudoers file
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You also have a problem with shell metacharacters.
consider your "sudo chmod <arbitrary file>"...
What if that arbitrary file is/or contains '`rm -rf /`'.....When that gets evaluated it will be reprocessed... with privileges.
It *COULD*...but again, if the shell script is written to look for/reject such things, it will kick out and die. You've got control of what goes in, and how it's tested.
And there are no perfect solutions to anything like this. There will ALWAYS be holes, as long as there are users. At least in this case, they can only run one shell script, and since it's preceded by sudo, the exact string/command will be logged. If someone does something wrong, it'll be VERY easy to spot, which will be a deterrent. And, if that user can't be trusted with sudo rights, they shouldn't be able to run anything as sudo. There's also a bit of security-through-obfuscation, since the user won't know what's in that shell script, what it looks for/logs, or how it works. Just that it DOES.
None of that is relevant if the user account gets compromised.
BTW, it is nearly impossible to get a shell script to validate strings properly...
Right. Again, this isn't a perfect solution, just the simplest for what the user needs to do.
As far as I know, there ARE no perfect solutions to security, other than locking your computer in a bank-vault, that only YOU can open, and never connecting it to a network or running any software that you, yourself didn't write.
And if a user account gets compromised, you have problems anyway, no matter which account it is.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.