インストールのメモ
-
インストールする。
# apt install fail2ban
- /etc/fail2ban/jail.conf を変更する。以下はインストール状態からの変更点のみ。
# diff jail.conf jail.conf.orgignoreip = 127.0.0.1/8 ::1 # ban 対象としない IP アドレスを指定 destemail = root@example.com # 送信先メールアドレスを設定
54c54
< ignoreip = 127.0.0.1/8 ::1
---
> #ignoreip = 127.0.0.1/8 ::1
63c63
< bantime = 10d
---
> bantime = 10m
70c70
< maxretry = 3
---
> maxretry = 5
137c137
< destemail = hogefuga@h-sol.jp
---
> destemail = root@localhost
# - 不要(jail.confにsshdのエントリがあり)
/etc/fail2ban/jail.d/sshd.conf を新規作成する。[sshd] enabled = true port = 22 logpath = %(sshd_log)s backend = %(sshd_backend)s action = %(action_mw)s -
fail2ban をdaemonで起動する
# update-rc.d fail2ban defaults
以上です。
コメント