Kaynağa Gözat

Separate firewall settings for ssh

Bob Mottram 10 yıl önce
ebeveyn
işleme
78fe6ee7e8
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5
    1
      install-freedombone.sh

+ 5
- 1
install-freedombone.sh Dosyayı Görüntüle

@@ -286,8 +286,11 @@ function configure_firewall {
286 286
   ip6tables -P INPUT DROP
287 287
 }
288 288
 
289
+function configure_firewall_for_ssh {
290
+  iptables -A INPUT -i eth0 -p tcp --dport $SSH_PORT -j ACCEPT
291
+}
292
+
289 293
 function configure_firewall_for_email {
290
-  iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
291 294
   iptables -A INPUT -i eth0 -p tcp --dport 25 -j ACCEPT
292 295
   iptables -A INPUT -i eth0 -p tcp --dport 587 -j ACCEPT
293 296
   iptables -A INPUT -i eth0 -p tcp --dport 465 -j ACCEPT
@@ -717,6 +720,7 @@ set_your_domain_name
717 720
 time_synchronisation
718 721
 defend_against_port_scanning
719 722
 configure_firewall
723
+configure_firewall_for_ssh
720 724
 configure_firewall_for_email
721 725
 save_firewall_settings
722 726
 configure_internet_protocol