Contact: Web / Voice / Email / Tips
Simple Thoughts Blog - Java and Web Technologies

Simple solutions for complex problems.

 

How To Block IP Addresses On Linux Server

July 12th, 2006 by Angsuman Chakraborty

Take a look at your log file (/var/log/secure for Fedora Core 4) and you will discover numerous automated ssh hacking attempts using dictionary attack. So now you have identified the offending addresses. How do you stop them?

Here comes the magic mantra which uses iptables (packet) firewall:

iptables -A INPUT -s a.b.c.d -j DROP

Replace a.b.c.d with the offending IP address. Repeat this for each of the offending IP addresses.


Tags: Computer Security, Headline News, How To, Linux, Open Source Software, Tech Note, Web, Web Hosting, Web Services | | RSS 2.0 | Trackback this Article | Email this Article

You may also like to read

»How To Add Multiple IP Addresses On Linux / Fedora Core / Fedora
»WordPress Comment Spamming - Over 50% Contributed by Top 100 IP Addresses
»Business Trip To USA, Mailing Problems with Translator Plugin Pro etc.
»Network Security Software Review: Agnitum Outpost Firewall versus ZoneAlarm Personal Firewall
»How To Find All IP Addresses on Linux
»How To Implement Round Robin DNS for Load Balancing Servers
»Comparison of Software RAID on Windows versus Linux
»Fighting With Linux Server Setup
»How To: ICMP Ping in Java (JDK 1.5 and above)
»How To Block MSN & P2P on Linux (Using Shorewall)
»Overview of Exploits Block List - XBL (Spamhaus.org) in Comment Spam Protection
»Changing IP's and Adding Servers
»How To Migrate Mantis Defect Tracking System From Windows To Linux / Fedora Core 6
»IP Address Changes...
»Network Masks / Netmasks for Dummies

4 Responses to “How To Block IP Addresses On Linux Server”

  1. pastri Says:

    With even less worries: only allow certain IPs to access SSH. Next to that install “knockd” to allow you to temporarily open up the firewall from the IP you are working on when you are working mobile.

  2. Angsuman Chakraborty Says:

    I cannot do that as I do not connect from dedicated ip addresses. I connect using a provider (BSNL) who allocated IP’s from a countrywide pool.

  3. IP Guy Says:

    It’s always good to block service access that are not required for public - for example, SSH.

  4. Detailed Post-Mortem of a Website Hack Through WordPress & How To Protect Your WordPress Blog From Hacking Says:

    [...] Their website is http://www.kuban.mts.ru/. They appear to be legitimate mobile & internet service provider. Most likely their internet service is being abused by the spammer. Nevertheless I decided to ban this IP address from accessing my server. [...]

Looking forward to hear your thoughts.



Please enter the code shown below ( to verify that you are human ) before you click Submit Comment.

No. 1 method to ethically increase your blog traffic and reach.

Translate

Translate to EnglishÜbersetzen Sie zum Deutsch/GermanPřeložit do Čech/CzechOversætte hen til Dansk/DanishKääntää jotta Finnish/FinnishLefordít -hoz Magyar/HungarianÞýða til Íslenska/IcelandicTraducir a Latinoamericano Español/Latin American Spanishtagapagsalin sa Filipino/FilipinoTłumaczyć wobec Polski/PolishA traduce la spre Român/RomanianPrevesti za Srpski/Serbiantolmačiti v slovenski/SlovenianÖversätta till Svensk/SwedishChyfieitha at Cymraeg/Welshtercüme etmek -e doğru Türk/TurkishPrevesti to Hrvatski/CroatianПревеждам към Българин/BulgarianTraduzca al Español/SpanishTraduisez au Français/FrenchTraduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplifiedترجمة الى العربية/ArabicVertaal aan het Nederlands/DutchΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/Norwegian中文翻译/Chinese TraditionalTraduzir a Língua portuguesa brasileira/Brazilian PortugueseReddo ut Latin/Latin

Taragana Network

»Ctrl-S
»Enterprise Blog
»Free Book on Eye Care by Natural Therapy
»Health Care Blog
»Hot Computer Jobs Blog
»Pet Care & Grooming News and Tips
»Phil Law Blog
»Taragana - Software Outsourcing
»The Angsuman Chakraborty Blog
»The Diabetes Cure Blog
»The Eye Treatment Blog
»The Stem Cell Blog
»Weblog Hosting Blog
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - Albert Einstein