Skip to content

Instantly share code, notes, and snippets.

@skorotkiewicz
Created December 8, 2016 15:19
Show Gist options
  • Save skorotkiewicz/5bb7c5796062622166ccd12f20ea5fd1 to your computer and use it in GitHub Desktop.
Save skorotkiewicz/5bb7c5796062622166ccd12f20ea5fd1 to your computer and use it in GitHub Desktop.
Block all SSH Access except one IP
#create access for specific IP:
iptables -A INPUT -m state --state NEW,ESTABLISHED,RELATED --source x.x.x.x -p tcp --dport 22 -j ACCEPT
#block all others
iptables -A INPUT -m state --state NEW,ESTABLISHED,RELATED -p tcp --dport 22 -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment