OK. Here's a first cut at a script to upgrade your PBX in a Flash system (only) to Fail2Ban 0.8.3. It has been configured to protect against password attacks in SSH, Apache, and Asterisk SIP. Feedback appreciated.
Log into your server as root, and...
|
Code:
|
cd /root
mkdir fail2ban
cd fail2ban
wget http://pbxinaflash.net/source/fail2ban/fail2ban-update
chmod +x fail2ban-update
./fail2ban-update |
Once the install finishes, be sure to check whether it's running. You should get two entries with this command:
|
Code:
|
ps aux | grep fail2ban-server |
If not, restart the service and repeat the test again.
|
Code:
|
service fail2ban restart |
We strongly recommend that you test all 3 password scenarios, i.e. log into your server 4 times with an incorrect SSH password; log into the FreePBX admin module 4 times with an incorrect maint password; use a softphone and log into a SIP extension on your server 4 times with an incorrect extension password. If you don't get blocked for 30 minutes in every case, there's a problem.