Re: Having problems with sudoers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 01/25/2012 05:09 AM, Steve Campbell wrote:
> it's saying that "sudo: sorry,  you must have a tty to
> run sudo".
>
> I'm trying to enable the user "apache" to have the ability to run an
> executable from a web page. One of the common solutions is to do the
> following:
>
> Defaults:apache  !requiretty
> apache    ALL = NOPASSWD:/program.name

Just had a look at this...  I don't see a way to use sudo with SELinux 
enabled, so we have to assume that you've disabled it or set it to 
permissive.  That'd be useful information to include.

If you've done so, the next question would be whether your CGI is 
actually running as apache, or whether you've got it SUID to some other 
user.

I've confirmed on my system that a simple CGI can run sudo with the 
following entries in sudoers:

Defaults:apache         !requiretty, visiblepw
Cmnd_Alias ROUTER = /usr/local/bin/set-shorewall-gateway
apache  ALL=(ALL)       NOPASSWD: ROUTER

If it's not working for you, first run "visudo", make a change to the 
file, then save and exit.  If you have the syntax broken somewhere, 
visudo will tell you.  If you don't get warnings, watch the logs while 
you try to use the web application:

tail -f /var/log/messages /var/log/secure /var/log/httpd/error_log

(or ssl_error_log)

Include the log entries that you see in your reply.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux