Changes
From SME Server
Jump to navigation
Jump to search
← Older edit
Newer edit →
Fail2ban
(view source)
Revision as of 16:52, 11 December 2015
5 bytes removed
,
16:52, 11 December 2015
→Example script which list How many ip are banned from all jails
Line 154:
Line 154:
nano /root/checklist_ban
nano /root/checklist_ban
−
#!/bin/bash
#!/bin/bash
#lancer le script en sudo
#lancer le script en sudo
−
JAILS=$(fail2ban-client status | grep " Jail list:" | sed 's/`- Jail list:
\t\t
//g' | sed 's/,//g')
+
JAILS=$(fail2ban-client status | grep " Jail list:" | sed 's/`- Jail list://g' | sed 's/,//g')
for j in $JAILS
for j in $JAILS
do
do
echo "$j $(fail2ban-client status $j | grep " Currently banned:" | sed 's/ |- Currently banned:\t//g')"
echo "$j $(fail2ban-client status $j | grep " Currently banned:" | sed 's/ |- Currently banned:\t//g')"
done
done
+
chmod 700 /root/checklist_ban
chmod 700 /root/checklist_ban
Line 167:
Line 167:
to launch the script, do the following command:
to launch the script, do the following command:
/root/checklist_ban
/root/checklist_ban
−
=== Unban an IP ===
=== Unban an IP ===
Stephdl
Administrators
5,576
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