Apache-2.2

ec2 實例超時

  • October 31, 2014

因此,在嘗試設置 Postfix 以進行郵件發送時,我被 ssh 連接到了正在執行的實例中。我正在學習本教程: http: //flurdy.com/docs/postfix/#ec2。我到了 Shorewall 部分並放棄了所有的指示。我想當我這樣做的時候,我把自己鎖在了我的 SSH 之外。

目前我想刪除將我鎖定在 ssh 之外的 Shorewall 防火牆。我怎麼能這樣做?

牆體設置:

/etc/shorewall/interfaces
net     eth0            detect          dhcp,tcpflags,logmartians,nosmurfs

/etc/shorewall/zones
Add the firewall if not there and the internet as a zone.
fw  firewall
# loc   ipv4
net     ipv4

/etc/shorewall/hosts
# loc   eth0:192.168.0.0/24

/etc/shorewall/policy
$FW             net             ACCEPT
net             $FW             DROP            info
net             all             DROP            info
# The FOLLOWING POLICY MUST BE LAST
all             all             REJECT          info

/etc/shorewall/routestopped
eth0            0.0.0.0                 routeback

/etc/shorewall/rules
Ping/ACCEPT     net             $FW

# Permit all ICMP traffic FROM the firewall TO the net zone
ACCEPT          $FW             net             icmp

# mail lines
SMTP/ACCEPT     net             $FW
SMTPS/ACCEPT    net             $FW
Submission/ACCEPT       net             $FW
IMAP/ACCEPT     net             $FW
IMAPS/ACCEPT    net             $FW

#web
Web/ACCEPT      net             $FW

解決此問題的正確方法是啟動一個新實例並掛載您的舊目錄。用新實例掛載舊目錄後,您應該能夠撤消防火牆並將其從實例啟動中刪除。然後重新啟動您的舊實例,防火牆將不會啟動。然後像往常一樣ssh進入它。

這是一個關於如何做的很好的教程。 https://aws.amazon.com/articles/5213606968661598

引用自:https://serverfault.com/questions/641182