Skip to content

Commit

Permalink
Write jail.local instead of overwriting existing config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Dahan committed Sep 15, 2024
1 parent 0ab3854 commit 3a3a137
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions utilities/pi-gen/stage-solar/00-install-solar-protocol/01-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ chown -R www-data:www-data /home/pi/solar-protocol/frontend
chmod 755 /home/pi
EOF

sed \
-e 's|\[sshd\]|\[sshd\]\n\nenabled = true\nfilter = sshd|' \
${ROOTFS_DIR}/etc/fail2ban/jail.conf > ${ROOTFS_DIR}/etc/fail2ban/jail.local
cat > ${ROOTFS_DIR}/etc/fail2ban/jail.local <<EOF
[sshd]
enabled = true
filter = sshd
backend = systemd
logpath = /var/log/auth.log
maxretry = 5
bantime = 3600
EOF

# TODO: confirm with Alex if this is safe to remove
#sed -i \
Expand Down

0 comments on commit 3a3a137

Please sign in to comment.