Last active
March 26, 2016 09:42
-
-
Save teyc/7a3c3289e4d442472a95 to your computer and use it in GitHub Desktop.
Linux setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install ufw | |
| sudo ufw disable | |
| sudo ufw default deny | |
| sudo ufw allow ssh | |
| sudo ufw allow http | |
| sudo ufw allow https | |
| sudo ufw enable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://mikhailian.mova.org/node/147 | |
| # requires hashlimit | |
| iptables -A INPUT -p tcp -m tcp --dport 22 -m state \ | |
| --state NEW -m hashlimit --hashlimit 1/hour \ | |
| --hashlimit-burst 2 --hashlimit-mode srcip \ | |
| --hashlimit-name SSH --hashlimit-htable-expire 60000 | |
| -j ACCEPT | |
| iptables -A INPUT -p tcp -m tcp --dport 22 \ | |
| --tcp-flags SYN,RST,ACK SYN -j DROP | |
| iptables -A INPUT -p tcp -m state \ | |
| --state NEW -m tcp --dport 22 -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment