1
0
鏡像自 https://github.com/mail-in-a-box/mailinabox.git synced 2025-07-18 01:30:55 +00:00

add alternative sshd port to ssh jail

This commit is contained in:
KiekerJan 2021-07-31 21:42:57 +02:00
父節點 128541d506
當前提交 104d40e819

查看文件

@ -364,9 +364,11 @@ if [ ! -z "$SSH_PORT" ]; then
if [ "$SSH_PORT" != "22" ]; then
# Add alternative SSH port
sed -i "s/port[ ]\+=[ ]\+ssh$/port = ssh,$SSH_PORT/g" /etc/fail2ban/jail.conf
sed -i "s/port[ ]\+=[ ]\+ssh$/port = ssh,$SSH_PORT/g" /etc/fail2ban/jail.d/geoipblock.conf
else
# Set SSH port to default
sed -i "s/port[ ]\+=[ ]\+ssh/port = ssh/g" /etc/fail2ban/jail.conf
sed -i "s/port[ ]\+=[ ]\+ssh/port = ssh/g" /etc/fail2ban/jail.d/geoipblock.conf
fi
fi