Dedicated Servers
Managed Dedicated Servers
Semi-Dedicated Hosting
Cheap Dedicated Servers
Hyper-V VPS Hosting
Hyper-V Virtual Private Servers
Linux VPS Hosting
VPS Hosting with Root Access
Windows VPS Hosting
Windows VPS Web Hosting
Reseller Hosting
Reseller Hosting India
cPanel Shared Hosting
Linux Shared Web Hosting
Windows Hosting
Windows Shared Web Hosting
Web Hosting Blog
Web Hosting Blog India
Hosting Knowledgebase
Web Hosting Knowledgebase




  #1 (permalink)  
Old 01-01-2009, 07:45 PM
Member
 
Join Date: Dec 2008
Posts: 78
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.
Reply With Quote
  #2 (permalink)  
Old 01-13-2009, 06:25 AM
Richie D's Avatar
Moderator
 
Join Date: Jan 2009
Posts: 27
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.
Reply With Quote
  #3 (permalink)  
Old 01-20-2009, 06:51 PM
Member
 
Join Date: Dec 2008
Posts: 78
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.
Reply With Quote
  #4 (permalink)  
Old 01-26-2009, 09:24 AM
Richie D's Avatar
Moderator
 
Join Date: Jan 2009
Posts: 27
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.
Reply With Quote
  #5 (permalink)  
Old 01-28-2009, 10:08 PM
Member
 
Join Date: Dec 2008
Posts: 78
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.
Reply With Quote
  #6 (permalink)  
Old 06-17-2010, 04:41 PM
Member
 
Join Date: Jun 2010
Posts: 50
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?
Reply With Quote
  #7 (permalink)  
Old 06-18-2010, 02:23 AM
Senior Member
 
Join Date: Aug 2009
Posts: 164
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.
Reply With Quote
  #8 (permalink)  
Old 06-18-2010, 05:26 PM
Member
 
Join Date: Jun 2010
Posts: 43
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.
Reply With Quote
  #9 (permalink)  
Old 06-19-2010, 02:49 AM
Senior Member
 
Join Date: Aug 2009
Posts: 164
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.
Reply With Quote
Reply

Bookmarks
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT. The time now is 04:57 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0