機場巧用iptables

機場運營·Linux·小知識 · 01-12 · 290 人浏览
機場巧用iptables

儅用戶連接機場節點時,為防止使用當前節點進行一些爆破滲透,可以在節點VPS上面設置禁止訪問目標指定端口,例如設置禁止 8000 端口,則連接該節點就訪問不了目標的8000端口的服務

例如一個網站為 1.1.1.1:8000,因爲節點VPS設置了禁止訪問端口,所以就無法訪問這個網站。

iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 22 -j DROP
iptables -A OUTPUT -p tcp --dport 3306 -j DROP
iptables -A OUTPUT -p tcp --dport 3389 -j DROP
iptables-save > /etc/iptables/rules.v4
Linux
本站立足于美利堅合衆國,請讀者自覺遵守當地法律!如有違規,本站不承擔任何法律責任! This site is based in the United States of America, readers are requested to abide by local laws! If there are any violations, this site does not bear any legal responsibility! Theme Jasmine by Kent Liao