Results 1 to 3 of 3

Thread: how to set iptable rules and access superuser permission from web-based?

  1. #1
    Join Date
    Jan 2010
    Beans
    2

    Smile how to set iptable rules and access superuser permission from web-based?

    Hi friends..
    i had wrote a network emulator program in c programming. It can run for ubuntu terminal with good performance. But i have to make it for web-based user configuration. So i had setup apache web server and write this program in cgi script and try to execute this program from web page. BUT IT CAN'T WORKS!!!

    This program must be run in root privilege($sudo -s) and add the iptables rules such as (#iptables -A OUTPUT -j QUEUE). So my question is how to add iptables rules in my cgi scripts? How to set the superuser(root privilege) permission to access my program through web server? Or any other method? your reply is highly appreciate... thanks..

  2. #2
    Join Date
    Aug 2008
    Location
    Washington DC
    Beans
    2,186
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: how to set iptable rules and access superuser permission from web-based?

    Setup sudo for your apache user "www-data" with permissions for iptables and invoke it from the script with sudo.

  3. #3
    Join Date
    Jan 2010
    Beans
    2

    Re: how to set iptable rules and access superuser permission from web-based?

    Quote Originally Posted by iponeverything View Post
    Setup sudo for your apache user "www-data" with permissions for iptables and invoke it from the script with sudo.
    Hi iponeverthing... i not quite understand how to setup sudo for apache, can you briefly explain the procedures? thanks...

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
  •