2

I am running Apache 2.4.8 on Arch Linux, but that doesn't matter really.

I would like to create a user who is devoted to web management. I have created a user, a group, and added the user to the group. How can I add a line with visudo to allow him to control the web based services?

I have the ownership of the web root set up correctly, but I need group "web" to be allowed to use "service.httpd", "apachectl", and other web programs.

What I have: %web ALL=(ALL) /usr/bin/httpd

Smuuf
  • 146
  • 7
Tim Palmer
  • 23
  • 3

1 Answers1

1

You've started off correctly. The line you have added needs to contain all the commands, exactly as they should be typed, separated by commas. You might also want to have the user NOT have to enter their password each time they use sudo, but that's up to you:

%web ALL=(ALL) NOPASSWD: service httpd restart, apachectl status, apachectl reload

These are just wrong examples. You will want to include the complete pathname to each command along with any parameters you require the user to use. The downside is that any commands that take multiple parameters have to be specified in the same order using the same syntax you use in your sudoers line. Commands that don't require parameters are easy.

Smuuf
  • 146
  • 7
LinuxNinja
  • 346
  • 1
  • 4
  • Ok... thanks. I thought there would just be like a simple one word name for all commands related to httpd or something. Sort of like how the wheel group can do all types of things... – Tim Palmer Jan 28 '16 at 21:46