Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2007
    Posts
    815

    help with script using curl executing ssh commands

    hello

    im trying to write a script interfacing to WHM again via remote access key. What I want to achieve is to remove an ip from iptables. using PHP script (CURL), any thoughts on how i can remove an ip from iptables? I know the ssh command how to do it but i dont know if it will work via a PHP (CURL) script connecting to WHM via remote access key.

  2. #2
    Join Date
    Apr 2003
    Location
    NC
    Posts
    3,093
    Well WHM itself does not have the ability to remove an IP from iptables.

    CSF may have an API to do this, I do not think so but perhaps.

    You would probably have to use sudo to have php gain root access in order to remove the IP. The other option is having it run csf/apf to remove the ip, again you will need sudo. There are a *LOT* of security implications of giving apache access to root - even if you restrict it. I never really recommend it and if you do you need to be very aware of just what you are doing.
    John W, CISSP, C|EH
    MS Information Security and Assurance
    ITEagleEye.com - Server Administration and Security
    Yawig.com - Managed VPS and Dedicated Servers with VIP Service

Posting Permissions

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