Changes
From SME Server
Jump to navigation
Jump to search
← Older edit
Newer edit →
Fail2ban
(view source)
Revision as of 14:06, 17 June 2015
655 bytes added
,
14:06, 17 June 2015
→Play with a script which list How many ip are banned from all jails
Line 163:
Line 163:
to launch the script, do the following command:
to launch the script, do the following command:
/root/checklist_ban
/root/checklist_ban
+
+
+
====Show IPs banned by service====
+
+
Here is another quick script that shows you the most recent IPs banned in the logs. Note that they may have been unbanned but there is no check for this:
+
+
nano /root/IP_list
+
+
#!/bin/sh
+
# Set CLI vars to something we can read
+
TYPE=$1
+
LOG=$2
+
# Set main grep string
+
SEARCH="Ban ((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])"
+
# Add the search term
+
SEARCH="\[$TYPE]\ $SEARCH"
+
# Now search the log
+
grep -oE "\[$TYPE\] Ban ((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])" $LOG
+
+
Usage :
+
IP_List [service] [log]
+
+
e.g.
+
IP_List qpsmtpd /var/log/fail2ban/daemon.log
==== Unban an IP ====
==== Unban an IP ====
ReetP
Bureaucrats
,
Administrators (Semantic MediaWiki)
,
Curators (Semantic MediaWiki)
,
Administrators
877
edits
Navigation menu
Page actions
Page
Discussion
View source
History
Page actions
Page
Discussion
More
Tools
In other languages
Personal tools
English
Log in
Koozali SME Server
Main Page
Welcome
Releases
Testimonials
Documentation
SME Server FAQ
Volunteering
Commercial Support
Recent activities
Dashboard
Recent wiki changes
Recent bug changes
Unread Forum posts
Koozali resources
Contribs
How-To's
Forums
Bugzilla
Mailing Lists
Translations
Download
Koozali SME Server wiki
Wiki statistics
Wiki categories
Wiki Help
Koozali Wiki Help
Tools
Special pages
Printable version
Search