Skip to content

Commit

Permalink
Read SSHPORT also from /etc/ssh/sshd_config.d/*.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeth committed May 15, 2023
1 parent fc46c81 commit 3387633
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion etc/firewall.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
# In order to configure, one might need the active sshd port "$SSHPORT":
# This port is read from /etc/ssh/sshd_config (default: "ssh")

SSHPORT=`sed -n -e 's/^ *Port *\([0123456789]*\) *$/\1/p' /etc/ssh/sshd_config` \
SSHPORT=`sed -n -e 's/^ *Port *\([0123456789]*\) *$/\1/p' \
/etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf 2>/dev/null` \
&& [ -n "${SSHPORT:++}" ] || SSHPORT='ssh'

# We setup an example how $SSHPORT can be reached from outside after
Expand Down

0 comments on commit 3387633

Please sign in to comment.