User ban by IP

How does one ban a user, using his/her IP?

Thank you.

  • I think it would be helpful if you use the 'tracker' plugin to track the IP address where the user logged-in last time and then ban that IP from your webhost control panel.

    The following link shows you how to ban/unban an IP using Cpanel.

    http://www.google.co.in/search?hl=&q=ban+IP+from+Cpanel&sourceid=navclient-ff&ie=UTF-8

  • Thank you for your help. However, I came a cross a neat PHP script that does the trick. 
    To be inserted on top of all essential PHP pages.
    Here it is:
    <?php
    $deny = array("111.111.111", "222.222.222", "333.333.333");
    if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) {
       header("location: http://www.google.com/");
       exit();
    } ?>
    Thanks to http://perishablepress.com/press/2007/07/03/how-to-block-ip-addresses-with-php/
    for this one.
  • The proper way to achieve this block is -->
    deny from 123.456.789.123
    in .htaccess

  • "The proper way to achieve this block is -->
    deny from 123.456.789.123
    in .htaccess"

    Over time, that method will only slow down elgg or any other script even more as the server will have to process htaccess rules. Elgg already has enough bottlenecks that makes it slow. Your method also does nothing to stop further processing of the htaccess file in which it will allow the banned IP access.

     

  • @dave --
    This does NOT slow down 
    Our flagship site with 112,000 registered users and approx 150++ users simultaneously online.. We have almost zero spammers ;-)
    The method works for us.
    I worked as Security Consultant for CitiBank n the 1970's.. helping by cracking into the mainframe applications to expose weaknesses and then fixed those security holes.
    What sort of an elgg-site do you run ?
    What are your numbers ?
    What sort of experience do you have in Computing Science ?
    What are you your qualifications ?
    What experience do you have in running very large elgg-based web-sites ?

  • Numbers have NOTHING to do with htaccess. Anybody worth a grain of salt or that has been in IT for some period of time understands that the more lines of "logic" or rules you place into htaccess files slows down the EXECUTION of your SERVER. Why, b/c apache has to process it first.

    If you really want to go there, then BENCHMARK what I am saying by placing 100 lines of DENY IP # into a htaccess file and doing your own test. OR let an a "penetration tester" / C.E.H. test FBKIDS for ya. I've got tools to deploy on any site granted I am not held liable for the frustration and reality check it may cause.... Can I help you realize (publicly) what I am saying here?

  • I see that you could not prove me wrong and  maybe it helped you and others understand that loading up an htaccess file with a bunch of DENY IP xxx.xxx.xxx.xxx is NOT the way to go! For the record, no university nor college taught Ethical Hacking & prevention 40 years ago and nowadays, preventing attacks is JUST as important as building the application. Sorry, but I hate when someone lamely instructs another person with the WRONG information. 40 years ago, a computer took up the space of a large room. They got laptops now.... USB drives,  and something called Google to consult, research and learn. -REALITY CHECKED-

  • @Dave....

    Are you so desperately looking for attention for your talents and knowledge ?

    Try to learn from the best of the best !

  • "Try to learn from the best of the best" - You shall learn that a slip of the foot will soon heal, but a slip of the tongue will never... Learn what from YOU? In your 40 plus years, you are still un-educated about the existence of how to prevent attacks...

    If you worked in IT in the 1970's, I am sure to dance circles around your knowledge or lack thereof. It's 2010. BTW, I don't go back and edit posts I previously make. But I have a screen shot of yours...

  • @Dave

    And yet for all of your posturing and attempts at flexing your epeen, you've failed to offer a different solution...

     

    Rather than the above, how about actually using your claimed knowledge and supply a recommendation and be useful.