Skip to content

Instantly share code, notes, and snippets.

@tavy315
Created November 2, 2017 12:59
Show Gist options
  • Save tavy315/1ea18a0f86b4379edfd0b92c04effd95 to your computer and use it in GitHub Desktop.
Save tavy315/1ea18a0f86b4379edfd0b92c04effd95 to your computer and use it in GitHub Desktop.
Allow specific IP to access port 22 and block access for everyone else
iptables -F
iptables -A INPUT -p tcp --dport 22 -s 192.168.0.1 -j ACCEPT -m comment --comment "office.i2ct.com"
iptables -A INPUT -p tcp --dport 22 -j DROP
iptables -L -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment