How do I give user sudo access to modify files in certain directories /etc/

686 Views Asked by At

I have a user who needs to modify files in /etc/haproxy and /etc/tomcat. I tried to create a sudoers file with:

%usergroup ALL=(ALL) NOPASSWD: /etc/haproxy /etc/tomcat

But it didn't work. Any help would be greatly appreciated.

1

There are 1 best solutions below

1
On

Sudoers won't give you the type of control you need. Instead, consider using groups. Assuming that those programs run as root:

  1. Define a new group
  2. Modify the group for those directories to be the new group.
  3. Give the group read/write permission to those directories.