Tuesday, June 9, 2009

Problem in running Iptables from CGI ?

Problem in running Iptables commands from CGI ?

 

This is because ,  CGI not having root privileges  even though you are login as root or Admin.

 

To run root privileges commands through CGI .

 

Step:

 

If you run sudo it will not support.So alter sudoers file and restarted apache.

 

 

1 comment:

  1. step 1: Run root commands like iptables from front end
    step 2:check error_log file in apache server
    it will show permission denied (you are not root)....
    step 3:Try iptables with sudo command
    step 4:Again check error_log
    if it shows
    "sudo: sorry, you must have a tty to run sudo, referer:..."
    step 5:goto /etc then edit sudoers using visudo
    and comment the line #Defaults requiretty
    step 6:Restart apache using
    #./apachectl -k restart
    Good luck

    ReplyDelete

Code Formater

Paste Here Your Source Code
Source Code Formatting Options
1) Convert Tab into Space :
2) Need Line Code Numbering :
3) Remove blank lines :
4) Embeded styles / Stylesheet :
5) Code Block Width :
6) Code Block Height :
7) Alternative Background :
Copy Formatted Source Code
 
Preview Of Formatted Code