Skip to content

Commit 92a4c2f

Browse files
authored
improved fail2ban support for vsftpd
1 parent 3fbd301 commit 92a4c2f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

install/vst-install-rhel.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,15 @@ if [ "$fail2ban" = 'yes' ]; then
12021202
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
12031203
sed -i "${fline}s/true/false/" /etc/fail2ban/jail.local
12041204
fi
1205+
if [ "$vsftpd" = 'yes' ]; then
1206+
#Create vsftpd Log File
1207+
if [ ! -f "/var/log/vsftpd.log" ]; then
1208+
touch /var/log/vsftpd.log
1209+
fi
1210+
fline=$(cat /etc/fail2ban/jail.local |grep -n vsftpd-iptables -A 2)
1211+
fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
1212+
sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local
1213+
fi
12051214
chkconfig fail2ban on
12061215
/bin/mkdir -p /var/run/fail2ban
12071216
sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/fail2ban/g" /usr/lib/systemd/system/fail2ban.service

0 commit comments

Comments
 (0)