Restart rsyslog when modify auth.log
This commit is contained in:
parent
80a0e9ee73
commit
e0fd5d8194
|
@ -18,7 +18,7 @@ fi
|
||||||
|
|
||||||
# Check dependencies
|
# Check dependencies
|
||||||
path_check="/usr/bin /bin /usr/local/bin /sbin ${HOME}/.local/bin"
|
path_check="/usr/bin /bin /usr/local/bin /sbin ${HOME}/.local/bin"
|
||||||
dependencies="iptables cat grep sort sed rm echo"
|
dependencies="iptables cat grep sort sed rm echo systemctl"
|
||||||
dependencies_found=""
|
dependencies_found=""
|
||||||
dependencies_not_found=""
|
dependencies_not_found=""
|
||||||
for checkPath in ${path_check} ; do
|
for checkPath in ${path_check} ; do
|
||||||
|
@ -90,6 +90,7 @@ while [ ${blockauth} -eq 0 ] ; do
|
||||||
echo "blockauth: allowing access for ${user}" >> ${filelog}
|
echo "blockauth: allowing access for ${user}" >> ${filelog}
|
||||||
sed -i "s/Failed password for ${user} from/blockauth\[allowed\]\: invalid pass for ${user} from/g" /var/log/auth.log
|
sed -i "s/Failed password for ${user} from/blockauth\[allowed\]\: invalid pass for ${user} from/g" /var/log/auth.log
|
||||||
sed -i "s/Failed password for invalid user ${user} from/blockauth\[allowed\]\: invalid pass for ${user} from/g" /var/log/auth.log
|
sed -i "s/Failed password for invalid user ${user} from/blockauth\[allowed\]\: invalid pass for ${user} from/g" /var/log/auth.log
|
||||||
|
systemctl restart rsyslog &> /dev/null
|
||||||
done
|
done
|
||||||
touch ${blocklist}
|
touch ${blocklist}
|
||||||
cat ${blocklist} > ${blocklist}.temp
|
cat ${blocklist} > ${blocklist}.temp
|
||||||
|
|
Loading…
Reference in New Issue
Block a user