Results 1 to 1 of 1

Thread: running perl script with privilege

  1. #1
    Join Date
    Mar 2012
    Beans
    1

    running perl script with privilege

    hi,
    i have a problem with privilege on ubuntu.
    i am trying to create cgi script using perl which need root privilege access.

    i use Net::Ping module, and here is the script which i tried to run.

    socket($self->{"fh"}, PF_INET, SOCK_RAW, $self->{"proto_num"}) || confess("icmp socket error - $!");

    I've already edit the sudoers file, and add these lines :

    # User privilege specification
    root ALL=(ALL) ALL

    # added by me
    User_Alias APACHE = www-data
    Cmnd_Alias FIREWALL = /sbin/iptables, /sbin/ifconfig, /sbin/route
    APACHE ALL = (ALL) NOPASSWD:FIREWALL


    i still cannot execute my cgi script command with browser, but it is fine when i execute it with terminal using
    root privilege. i think i still have misconfiguration on that sudoers file.

    Need your advice.
    Last edited by cariboo; March 24th, 2012 at 01:35 AM. Reason: removed smiley

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •