Results 1 to 9 of 9

Thread: Banning an IP address on Linux server

  1. #1

    Default Banning an IP address on Linux server

    You can easily ban an IP address on your server with APF firewall installed

    1) Login to your server as root.

    2) Enter apf –d <ip>

    3) Rebooting your server resets all your IP bans. This is due to the default settings. This is the reason that APF firewall is recommended for security as it will help you to secure your server.

    4) Now open the deny hosts file. Scroll to the bottom and simply enter the IP address you want to ban.

    5) Now just press control+X and then Y which will save your setting. These setting become the default settings then.

    6) Exit and restart your APF and you are done.

  2. #2

    Smile

    That's quite interesting.
    Thanks for sharing that information. I would also like to know the steps to Unban a particular IP address as there are a lot of instances when you need to ban an IP address for a short span.
    Last edited by Richie D; 01-13-2009 at 06:30 AM.

  3. #3

    Smile

    It is also possible to unban an IP address using IP tables on a Linux server. Follow the steps given below to unban an IP address on Linux server :

    1) Login to you Linux server as SSH root.

    2) Use the commands given below

    iptables -D INPUT -p all -s IP.ADDRESS.HERE -j DROP
    iptables -D OUTPUT -p all -s IP.ADDRESS.HERE -j DROP

    Once you use these commands correctly, you will be able to remove the IP address you wish to from the list of banned IP addresses.

    3) Make sure you save and restart the IP tables service by using the commands given below

    service iptables save
    service iptables restart

    If you have used these commands correctly and everything goes well, the IP address will be unsuspended.

  4. #4

    Default

    Now with this information it completes the entire process as one needs to be aware of the both the options in order to use it. Thank for the quick update Carl. You are simply great.

  5. #5

    Smile

    Thank you for your kind words Richie. You are right, one should have the complete information about anything which allows him to take a decision and work on it. Also, it helps him to understand the concept and take the right decision at the right time.

  6. #6

    Default re ban

    If resetting your server resets all of your bands does this mean that every time you reboot your server you have to go back and re ban everyone? How long does that take? Where do you suggest you keep your back up list of bans?

  7. #7
    Join Date
    Aug 2009
    Posts
    211

    Default

    Quote Originally Posted by nevaeh View Post
    If resetting your server resets all of your bands does this mean that every time you reboot your server you have to go back and re ban everyone?
    Nope. You will have to reset all the bans only if you did not save all the banned content. If you save all the users or IP's which are banned, you will find that the settings remain the same.

    Quote Originally Posted by nevaeh View Post
    How long does that take?
    The time taken to restore the settings if you have not saved them depends on the kind of settings you have on the server and the banned users or IP's.

    Quote Originally Posted by nevaeh View Post
    Where do you suggest you keep your back up list of bans?
    There is no specific method of taking backup of list of banned content. You can simply note down the banned users and IP's on the server and then refer to it if necessary.

    Please feel free to post if you have any further questions.

  8. #8

    Default

    Quote Originally Posted by Chirag O View Post
    There is no specific method of taking backup of list of banned content. You can simply note down the banned users and IP's on the server and then refer to it if necessary.
    Do you have any suggestions as far as keeping something like this organized? I have ran into it a few times and just been using Excel as a quick way, then saving it on a Dropbox for both my home and work machine at the office.

  9. #9
    Join Date
    Aug 2009
    Posts
    211

    Default

    Quote Originally Posted by cresdins View Post
    Do you have any suggestions as far as keeping something like this organized? I have ran into it a few times and just been using Excel as a quick way, then saving it on a Dropbox for both my home and work machine at the office.
    Well, as far as I know, there are no such applications or programs which will help you to keep the banned content organized, however, Excel or Open Office Spreadsheet can be considered as good applications to keep banned content organized.

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
  •