$ sudo service fail2ban restart
/etc/init.d/fail2ban: Zeile 13: /etc/init.d/functions: Datei oder Verzeichnis nicht gefunden
Stopping fail2ban: /etc/init.d/fail2ban: Zeile 54: echo_success: Kommando nicht gefunden.
Starting fail2ban: ^CTraceback (most recent call last):
File "/usr/bin/fail2ban-server", line 38, in <module>
from server.server import Server
File "/usr/share/fail2ban/server/server.py", line 33, in <module>
from asyncserver import AsyncServer
File "/usr/share/fail2ban/server/asyncserver.py", line 24, in <module>
__author__ = "Cyril Jaquier"
KeyboardInterrupt
/etc/init.d/fail2ban: Zeile 38: echo_failure: Kommando nicht gefunden.
Da paßt offenbar das Service-Skript nicht zu Deinem System (das Skript erwartet LSB-kompatibles init, offenbar ist das - auch dem Kommando nach, mit dem Du startest - aber bei Dir nicht vorhanden). Ohne weitere Informationen dazu (also welches System, woher stammt das fail2ban-Paket, usw.) ist Hilfe nicht möglich/sinnvoll./etc/init.d/fail2ban: Zeile 13: /etc/init.d/functions: Datei oder Verzeichnis nicht gefunden
Stopping fail2ban: /etc/init.d/fail2ban: Zeile 54: echo_success: Kommando nicht gefunden.
Ich darf mal kurz aus der verlinkten Seite zitieren?Ich habe [...] auch die automatische mit dem Script ausprobiert auf meinem Raspberry Pi mit Raspbian.
Linux ist nun mal nicht gleich Linux ... man sollte schon wissen, wie das eigene System den Start von Services handhabt. Damit dürfte die Zeile 42 im erwähnten Skript eher nicht zu Deinem System passen und Du solltest Dir den letzten oben zitierten Satz doch zu Herzen nehmen.This script was written by Cédric Brohée in order to simplify and accelerate the integration of the solution in a basic Asterisk configuration on Red Hat.
Do not hesitate to read the bash script and make changes to match your own configuration.
2015-05-20 17:20:20,933 fail2ban.server : INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.8.6
2015-05-20 17:20:20,943 fail2ban.jail : INFO Creating new jail 'ssh'
2015-05-20 17:20:20,953 fail2ban.jail : INFO Jail 'ssh' uses Gamin
2015-05-20 17:20:21,209 fail2ban.filter : INFO Added logfile = /var/log/auth.log
2015-05-20 17:20:21,219 fail2ban.filter : INFO Set maxRetry = 6
2015-05-20 17:20:21,236 fail2ban.filter : INFO Set findtime = 600
2015-05-20 17:20:21,245 fail2ban.actions: INFO Set banTime = 600
2015-05-20 17:20:21,998 fail2ban.jail : INFO Creating new jail 'asterisk-iptables'
2015-05-20 17:20:22,000 fail2ban.jail : INFO Jail 'asterisk-iptables' uses Gamin
2015-05-20 17:20:22,018 fail2ban.filter : INFO Added logfile = /var/log/asterisk/messages
2015-05-20 17:20:22,029 fail2ban.filter : INFO Set maxRetry = 3
2015-05-20 17:20:22,046 fail2ban.filter : INFO Set findtime = 600
2015-05-20 17:20:22,055 fail2ban.actions: INFO Set banTime = 259200
2015-05-20 17:20:22,607 fail2ban.jail : INFO Jail 'ssh' started
2015-05-20 17:20:22,727 fail2ban.jail : INFO Jail 'asterisk-iptables' started
[2015-05-20 18:34:54] NOTICE[25557]: chan_sip.c:22753 handle_request_invite: Call from '' (94.23.213.220:5078) to extension '00972592423912' rejected because extension not found in context 'guest'.
[2015-05-20 18:46:43] NOTICE[25557]: chan_sip.c:22753 handle_request_invite: Call from '' (94.23.213.220:5071) to extension '00972592423912' rejected because extension not found in context 'guest'.
[2015-05-20 18:52:46] NOTICE[25557]: chan_sip.c:22753 handle_request_invite: Call from '' (94.23.213.220:5071) to extension '00972592423912' rejected because extension not found in context 'guest'.
[2015-05-20 18:58:43] NOTICE[25557]: chan_sip.c:22753 handle_request_invite: Call from '' (94.23.213.220:5078) to extension '00972592423912' rejected because extension not found in context 'guest'.
failregex = NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Wrong password
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - No matching peer found
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - No matching peer found
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Username/auth name mismatch
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Device does not match ACL
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Peer is not supposed to register
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - ACL error (permit/deny)
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Device does not match ACL
NOTICE.* .*: Call from '.*' (<HOST>:.*) to extension '.*' rejected because extension not found in context 'guest'\.
NOTICE.* <HOST>:.* failed to authenticate as '.*'$
NOTICE.* .*: No registration for peer '.*' \(from <HOST>:.*\)
NOTICE.* .*: Host <HOST>:.* failed MD5 authentication for '.*' (.*)
NOTICE.* .*: Failed to authenticate user .*@<HOST>
NOTICE.* .*: Sending fake auth rejection for device .*\<sip:.*\@<HOST>\>;tag=.*
NOTICE.* .*: Call from .* (<HOST>:.*) to extension '.*' rejected because extension not found in context 'guest'\.
NOTICE.* .*: Call from .* (<HOST>:.*) to extension '.*' rejected because extension not found in context 'guest'\.
NOTICE.* .*: Call from .* (<HOST>:.*) to extension '.*' rejected because extension not found in context 'guest.*
[asterisk-iptables]
enabled = true
filter = asterisk
action = iptables-allports[name=ASTERISK, protocol=all]
sendmail-whois[name=ASTERISK, dest=root, [email protected]]
logpath = /var/log/asterisk/messages
maxretry = 3
bantime = 20000
Das liegt daran, weil der Asterisk zu geschwätzig ist.Aber die ganzen "Call from x to x rejected because extension not found in context guest" nicht.
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.178.1:43347;branch=z9hG4bK.56107dca;alias;received=93.220.38.225;rport=43347
From: sip:[email protected]:43347;tag=414f3f6c
To: sip:**.spdns.**:5070;tag=as73b60885
Call-ID: [email protected]
CSeq: 1 OPTIONS
Server: Asterisk PiBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Accept: application/sdp
Content-Length: 0
SIP/2.0 406 Not Acceptable
Via: SIP/2.0/UDP 192.168.178.1:37532;branch=z9hG4bK.52d75ab7;rport=37532;alias;received=93.220.38.225
From: <sip:[email protected]:37532>;tag=5350fc70
To: <sip:**.spdns.**:5060>;tag=890BDFF8DBB940A1
Call-ID: [email protected]
CSeq: 1 OPTIONS
User-Agent: FRITZ!OS
Content-Length: 0
[2015-05-23 12:37:50] NOTICE[25557] chan_sip.c: Call from '' (217.172.xxx.34:6385) to extension '8800' rejected because extension not found in context 'guest'.
NOTICE.* .*: Call from '.*' \(<HOST>:.*\) to extension '.*' rejected because extension not found in context 'guest'\.
[default]
;
; By default we include the demo. In a production system, you
; probably don't want to have the demo there.
;
include => ani
exten => _X.,1,Answer
exten => _X.,n,Gosub(ani)
exten => _X.,n,Hangup
[globals]
... bla ...
[general]
... bla ...
[internal]
... bla ...
[phones]
... bla ...
[incoming]
... bla ...
[outgoing]
... bla ...
[32]
callerid=32 <32>
user=32
secret=passwort
host=dynamic
deny=0.0.0.0/0.0.0.0
permit=192.168.3.59/255.255.255.255 ; hier kommt die feste IP rein und wird mit 4x255 "verriegelt"
type=friend
context=buero