Sudo access to specific files/services
Hello all,
Im hoping someone can help. I'm looking at giving restricted access to a user using sudo. I want to give them read/write access to a file and access to restart a service. The user is in the users group, in the sudoers file there is a section to allow users to shutdown system. So i was gonna put the entry there user localhost=/etc/init.d/dhcpd restart (this is to restart service) i dont know where i could put the file access path or how to restrict that user to be able to edit that 1 file only. |
For the file restriction it would be easier to use acls.
Code:
setfacl -m u:username:rw filename Code:
getfacl filename Code:
Code:
|
As for the sudoers running a specific command I'd use:
Code:
Code:
I've added the above lines to my sudoers file. I can login as sudo but can't execute the service restart stop etc. |
Make sure when you run it you put sudo infront of it.
Code:
Code:
|
Awesome thanks for your help!
|
No problem.
|
All times are GMT -5. The time now is 02:47 PM. |