你好,新年快乐,
我想知道是否可以在使用bridge-util的虚拟主机上使用fail2ban。我使用LXC容器进行虚拟化,因此可以直接访问主机环境中的所有日志文件。如果我能够只在主机上安装fail2ban并同时保护所有的虚拟盒,那就太好了。
我只是不确定fail2ban与桥-util的工作效果如何,或者我是否需要考虑这种方法。
谢谢,让我们期待一个更美好的一年(2012)
发布于 2012-01-01 05:47:51
新年快乐:)
fail2ban可以使用自定义命令。你需要:
cd /etc/fail2ban
cp jail.conf jail.local
在jail.local中:
[ssh-host1]
enabled = true
port=ssh
filter=sshd
logpath=/path/to/host1/logs/auth.log
maxretry=6
banaction=bridge-utils创建action.d/bridge-utils.local:
[Definition]
# executed once at the start of fail2ban
actionstart = brctl ...
# executed once at the end of fail2ban
actionstop = brctl ...
# executed once before each actionban command
actioncheck = ...
# ban action
actionban = brctl ...
brctl ...
# unban action
actionunban = brctl ...
brctl ...
[Init]
# some default variables here重新启动fail2ban并测试它是否正常工作。
https://serverfault.com/questions/345652
复制相似问题