Operating System - Linux
1827712 Members
2635 Online
109967 Solutions
New Discussion

Re: sudoer file help required...

 
girishb
Frequent Advisor

sudoer file help required...

Hi,

I need to make entry in sudoer file for couple of application users on RHEL3.0 and Redhat Linux 9.0 Server.

The user must have Read,Write and Execute permission on /var/www folder.

Also the user should be able to start and stop only apache server.

I'm a new bie in Linux and I would like to know what entry should I make in the sudeor file to provide the access..

Thanks in advance for all your Linux Experts onboard....

Girish
4 REPLIES 4
Ivan Ferreira
Honored Contributor

Re: sudoer file help required...

For the folder permissions, use the following commands:

groupadd webdev
chgrp -R webdev /var/www
chmod -R g+w /var/www
usermod -G webdev username

These commands will allow the users in the webdev group to have RWX permissions for the /var/www folder.

The sudoers entry should be:

Host_Alias WEBSERV=host1, host2, host3

User_Alias WEBDEV=user1,user2,user3

Cmnd_Alias WEBCMD=/sbin/service httpd *

WEBDEV WEBSERV = WEBCMD

Use the same entry for all hosts.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Krastev
Honored Contributor

Re: sudoer file help required...

If you add group for users you can use also this:

%groupname host = command
in this case

%webdev WEBSERV = WEBCMD


regards,
ivan
girishb
Frequent Advisor

Re: sudoer file help required...

Thank you very much IVAN's

Appreciate your responses...
Ivan Ferreira
Honored Contributor

Re: sudoer file help required...

Hi girishb. You are welcome. Please see also:

http://forums1.itrc.hp.com/service/forums/helptips.do?#28


And take a time to review the answers for your questions without assigned points:

http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA1411434&listType=unassigned&forumId=1

Cheers!
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?