From 92a4c2f377161d702c64a193001264769e5127e4 Mon Sep 17 00:00:00 2001 From: Joe Mattos Date: Mon, 11 Dec 2017 03:14:29 -0500 Subject: [PATCH 1/2] improved fail2ban support for vsftpd --- install/vst-install-rhel.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 166c63c7..968a3de8 100755 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -1202,6 +1202,15 @@ if [ "$fail2ban" = 'yes' ]; then fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -) sed -i "${fline}s/true/false/" /etc/fail2ban/jail.local fi + if [ "$vsftpd" = 'yes' ]; then + #Create vsftpd Log File + if [ ! -f "/var/log/vsftpd.log" ]; then + touch /var/log/vsftpd.log + fi + fline=$(cat /etc/fail2ban/jail.local |grep -n vsftpd-iptables -A 2) + fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -) + sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local + fi chkconfig fail2ban on /bin/mkdir -p /var/run/fail2ban sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/fail2ban/g" /usr/lib/systemd/system/fail2ban.service From 0277d84fe4de222200b460210d1b4e98804a3a10 Mon Sep 17 00:00:00 2001 From: Joe Mattos Date: Mon, 11 Dec 2017 07:47:50 -0500 Subject: [PATCH 2/2] improve fail2ban support for vsftpd --- install/vst-install-ubuntu.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 07d17492..37a9f265 100755 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -1158,6 +1158,15 @@ if [ "$fail2ban" = 'yes' ]; then fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -) sed -i "${fline}s/true/false/" /etc/fail2ban/jail.local fi + if [ "$vsftpd" = 'yes' ]; then + #Create vsftpd Log File + if [ ! -f "/var/log/vsftpd.log" ]; then + touch /var/log/vsftpd.log + fi + fline=$(cat /etc/fail2ban/jail.local |grep -n vsftpd-iptables -A 2) + fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -) + sed -i "${fline}s/false/true/" /etc/fail2ban/jail.local + fi update-rc.d fail2ban defaults service fail2ban start check_result $? "fail2ban start failed"