From owner-freebsd-questions@FreeBSD.ORG Sat Jul 23 13:52:53 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E5A916A428 for ; Sat, 23 Jul 2005 13:52:53 +0000 (GMT) (envelope-from news@jeronimus.homeunix.net) Received: from jeronimus.homeunix.net (jeremino.xs4all.nl [80.126.224.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA20643D45 for ; Sat, 23 Jul 2005 13:52:52 +0000 (GMT) (envelope-from news@jeronimus.homeunix.net) Received: from news by jeronimus.homeunix.net with local (Exim 4.42) id 1DwK5W-0000d3-SM for freebsd-questions@freebsd.org; Sat, 23 Jul 2005 15:30:47 +0200 From: "marek" X-Newsgroups: list.freebsd.questions Date: Sat, 23 Jul 2005 09:12:58 -0400 (EDT) Organization: XS4ALL Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Lines: 88 X-Complaints-To: abuse@xs4all.nl To: freebsd-questions@freebsd.org Sender: News Subsystem Subject: sudo for www user to run root shell script via browser X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2005 13:52:53 -0000 hi I have freebsd 5.4 and need sudo for www (apache) user to run a startup root script ntop.sh from cgi-bin directory via browser using a per script: ----------------------------------------------------------------------------------- #!/usr/bin/perl -w use CGI; my $query = new CGI; print $query->header; print "\n"; print "\n"; print "ntop startup script\n"; print "\n"; print "\n"; print "\n"; print "
"; print "


"; print "


"; 'sudo sh /usr/local/www/cgi-bin/ntop/ntop.sh stop' or die "cannot stop ntop: $!"; sleep(8); $cc = 'sudo sh /usr/local/www/cgi-bin/ntop/ntop.sh start' or die "cannot start ntop: $!"; print "Status: ",$cc,"\n"; print ""; print ""; exit($cc); ----------------------------------------------------------------------------------- I did: # cp /usr/local/etc/rc.d /usr/local/www/cgi-bin/ntop # cd /usr/local/www/cgi-bin/ntop # chmod 755 ntop.sh # chown www ntop.sh I've created in in /usr/local/etc/sudoers following entry: www ALL=(ALL) NOPASSWD: ALL but it doesn't work. if I try from command line as root user: # sudo -u www sh /usr/local/www/cgi-bin/ntop/ntop.sh start ntopbsd# ntop won't start. what's wrong and how can I execute this script via browser ? greetings marek _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"