为了能快速了解并处理您的问题,请提供以下基础信息: 面板、插件版本:bt 8.0.1 Fail2ban 1.7
相关截图(日志、错误): + PATH=/www/server/panel/pyenv/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin
+ export PATH
+ py_v=/usr/bin/python
+ '[' -d /www/server/panel/pyenv ']'
+ py_v=/www/server/panel/pyenv/bin/python
+ mkdir /var/run/fail2ban
mkdir: 无法创建目录 “/var/run/fail2ban”: 文件已存在
+ plugin_path=/www/server/panel/plugin/fail2ban
+ action=install
+ '[' install == install ']'
+ Install_fail2ban
+ mkdir -p /www/server/panel/plugin/fail2ban/cdn
+ cd /tmp
+ '[' -f /usr/bin/yum ']'
+ yum install git -y
+ yum install rsyslog -y
+ new_install
+ cp /www/server/panel/plugin/fail2ban/fail2ban.tar.gz /tmp/fail2ban.tar.gz
+ cd /tmp
+ tar -zxf fail2ban.tar.gz
+ cp /tmp/fail2ban/files/debian-initd /etc/init.d/fail2ban
+ cd /tmp/fail2ban
+ /www/server/panel/pyenv/bin/python setup.py install
error in fail2ban setup command: use_2to3 is invalid.
+ rm -rf /tmp/fail2ban
+ rm -f /usr/bin/fail2ban-client
+ rm -f /usr/bin/fail2ban-server
+ '[' /www/server/panel/pyenv/bin/python '!=' /usr/bin/python ']'
+ ln -s /www/server/panel/pyenv/bin/fail2ban-server /usr/bin/fail2ban-server
+ ln -s /www/server/panel/pyenv/bin/fail2ban-client /usr/bin/fail2ban-client
+ '[' '!' -f /usr/bin/fail2ban-client ']'
+ new_install
+ cp /www/server/panel/plugin/fail2ban/fail2ban.tar.gz /tmp/fail2ban.tar.gz
+ cd /tmp
+ tar -zxf fail2ban.tar.gz
+ cp /tmp/fail2ban/files/debian-initd /etc/init.d/fail2ban
+ cd /tmp/fail2ban
+ /www/server/panel/pyenv/bin/python setup.py install
error in fail2ban setup command: use_2to3 is invalid.
+ rm -rf /tmp/fail2ban
+ rm -f /usr/bin/fail2ban-client
+ rm -f /usr/bin/fail2ban-server
+ '[' /www/server/panel/pyenv/bin/python '!=' /usr/bin/python ']'
+ ln -s /www/server/panel/pyenv/bin/fail2ban-server /usr/bin/fail2ban-server
+ ln -s /www/server/panel/pyenv/bin/fail2ban-client /usr/bin/fail2ban-client
+ sed -i 's/pidfile\s=.*/pidfile = \/www\/server\/panel\/plugin\/fail2ban\/fail2ban\.pid/g' /etc/fail2ban/fail2ban.con
f
sed:无法读取 /etc/fail2ban/fail2ban.conf:没有那个文件或目录
+ sed -i 's/socket\s=\s\/.*/socket = \/www\/server\/panel\/plugin\/fail2ban\/fail2ban\.sock/g' /etc/fail2ban/fail2ban.
conf
sed:无法读取 /etc/fail2ban/fail2ban.conf:没有那个文件或目录
+ '[' '!' -f /etc/fail2ban/jail.local ']'
+ cp /www/server/panel/plugin/fail2ban/jail.local /etc/fail2ban/jail.local
cp: 无法创建普通文件'/etc/fail2ban/jail.local': 没有那个文件或目录
++ grep -v '#' /etc/ssh/sshd_config
++ awk '{print $2}'
++ tr '\n' ,
++ grep Port
+ sshport=2969,
+ sshport=2969
+ '[' 2969 = '' ']'
+ sed -i 's/port = 22/port = 2969/g' /etc/fail2ban/jail.local
sed:无法读取 /etc/fail2ban/jail.local:没有那个文件或目录
+ ftpport=21
+ '[' -f /www/server/pure-ftpd/etc/pure-ftpd.conf ']'
+ jsonconf='{"sshd": {"maxretry": 5, "findtime": 300, "act": "true", "port": "2969", "dir": "", "bantime": 86400},"ftp
d": {"maxretry": 5, "findtime": 300, "act": "true", "port": 21, "dir": "", "bantime": 86400}}'
+ '[' '!' -f /www/server/panel/plugin/fail2ban/config.json ']'
+ '[' -f /var/log/auth.log ']'
+ '[' '!' -f /etc/redhat-release ']'
+ grep -v '#' /etc/rsyslog.conf
+ grep messages
+ '[' 0 -ne 0 ']'
+ '[' '!' -f /var/log/messages ']'
+ systemctl restart rsyslog
+ systemctl unmask fail2ban
+ systemctl daemon-reload
+ systemctl restart fail2ban
+ systemctl enable fail2ban
+ echo Successify
+ echo 1
看日志像是没有权限,用以下的方法尝试手动安装也不行- wget -O /tmp/fail2ban.tar.gz http://download.bt.cn/install/plugin/fail2ban/fail2ban.tar.gz -T 5
- cd /tmp
- tar -zxf fail2ban.tar.gz
- cp /tmp/fail2ban/files/debian-initd /etc/init.d/fail2ban
- cd /tmp/fail2ban
- /www/server/panel/pyenv/bin/python setup.py install
复制代码 执行的拷贝`/etc/init.d/fail2ban` 时也提示没有
|
|