简体   繁体   English

Fail2ban - 使用 exec 或 shell_exec 从 php 脚本手动添加 ip

[英]Fail2ban - Add manually ip from php script using exec or shell_exec

i'm trying to add ip to fail2ban banlist instantly when detect differs types of ungrateful visitors, i'm trying do this from php script running next command with 'shell' or 'shell_exec':我正在尝试在检测到不同类型的忘恩负义的访问者时立即将 ip 添加到 fail2ban 禁止列表,我正在尝试从 php 脚本中使用“shell”或“shell_exec”运行下一个命令来执行此操作:

exec('fail2ban-client -vvv set ssh-iptables banip 123.123.123.123'); exec('fail2ban-client -vvv set ssh-iptables banip 123.123.123.123');

(I would like use native detections of fail2ban and additionally add or remove bans manually from my admin zone in my own website.) (我想使用 fail2ban 的本机检测,并另外从我自己网站的管理区域手动添加或删除禁令。)

But, this method doesn't work...但是,这个方法行不通……

Any idea?任何的想法? Thanks!谢谢!

Hi please try with full path of fail2ban-client you can get it by entering嗨,请尝试使用fail2ban-client的完整路径,您可以通过输入获得它

which fail2ban-client

at shell.在壳。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM