Last active
February 3, 2016 09:03
-
-
Save dineshsprabu/83a366c4061ef969da95 to your computer and use it in GitHub Desktop.
IPTable Rule for Allowing SSH and Denying all other ports
This file contains 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
/* iptable rule for droping connections through eth0 to all ports except 22(ssh) */ | |
>> iptables -A INPUT -i eth0 -p tcp ! --dport 22 -j DROP | |
/* Check applied rule */ | |
>> iptables -L | |
target prot opt source destination | |
DROP tcp -- anywhere anywhere tcp dpt:!ssh | |
Chain FORWARD (policy ACCEPT) | |
target prot opt source destination | |
Chain OUTPUT (policy ACCEPT) | |
target prot opt source destination |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment