Skip to content

Commit ca76ac2

Browse files
Merge pull request hestiacp#1369 from cdnmall/patch-2
improved fail2ban support for vsftpd
2 parents a2c7eed + 0277d84 commit ca76ac2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

install/vst-install-rhel.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,15 @@ if [ "$fail2ban" = 'yes' ]; then
12271227
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
12281228
sed -i "${fline}s/true/false/" /etc/fail2ban/jail.local
12291229
fi
1230+
if [ "$vsftpd" = 'yes' ]; then
1231+
#Create vsftpd Log File
1232+
if [ ! -f "/var/log/vsftpd.log" ]; then
1233+
touch /var/log/vsftpd.log
1234+
fi
1235+
fline=$(cat /etc/fail2ban/jail.local |grep -n vsftpd-iptables -A 2)
1236+
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
1237+
sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local
1238+
fi
12301239
chkconfig fail2ban on
12311240
/bin/mkdir -p /var/run/fail2ban
12321241
sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/fail2ban/g" /usr/lib/systemd/system/fail2ban.service

install/vst-install-ubuntu.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,15 @@ if [ "$fail2ban" = 'yes' ]; then
11721172
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
11731173
sed -i "${fline}s/true/false/" /etc/fail2ban/jail.local
11741174
fi
1175+
if [ "$vsftpd" = 'yes' ]; then
1176+
#Create vsftpd Log File
1177+
if [ ! -f "/var/log/vsftpd.log" ]; then
1178+
touch /var/log/vsftpd.log
1179+
fi
1180+
fline=$(cat /etc/fail2ban/jail.local |grep -n vsftpd-iptables -A 2)
1181+
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
1182+
sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local
1183+
fi
11751184
update-rc.d fail2ban defaults
11761185
service fail2ban start
11771186
check_result $? "fail2ban start failed"

0 commit comments

Comments
 (0)