mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 13:24:24 -07:00
Merge pull request #1819 from pablobae/pablobae-patch1
Update v-add-firewall-chain getting ssh port from ssh config file (not hardcoded)
This commit is contained in:
commit
66473a41d9
1 changed files with 7 additions and 1 deletions
|
@ -47,7 +47,13 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
|
|||
|
||||
# Checking known chains
|
||||
case $chain in
|
||||
SSH) port=22; protocol=TCP ;;
|
||||
SSH) # Get ssh port by reading ssh config file.
|
||||
sshport=$(grep '^Port ' /etc/ssh/sshd_config | head -1 | cut -d ' ' -f 2)
|
||||
if [ -z "$sshport" ]; then
|
||||
sshport=22
|
||||
fi
|
||||
port=$sshport;
|
||||
protocol=TCP ;;
|
||||
FTP) port=21; protocol=TCP ;;
|
||||
MAIL) port='25,465,587,2525,110,995,143,993'; protocol=TCP ;;
|
||||
DNS) port=53; protocol=UDP ;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue