Skip to content

Instantly share code, notes, and snippets.

@csghone
Created December 20, 2019 07:33
Show Gist options
  • Select an option

  • Save csghone/b1e02fb893144a74dfdaaa67f59f9a6c to your computer and use it in GitHub Desktop.

Select an option

Save csghone/b1e02fb893144a74dfdaaa67f59f9a6c to your computer and use it in GitHub Desktop.
Few IPTABLES commands
# Block internet access and limit SSH to single host to user 'vnc'
# NOTE: This is not a perfect implementation, it can be worked around.
sudo iptables -A OUTPUT -p tcp -m tcp --dport 80 -m owner --uid-owner vnc -j DROP
sudo iptables -A OUTPUT -p tcp -m tcp --dport 443 -m owner --uid-owner vnc -j DROP
sudo iptables -A OUTPUT ! -d 192.168.101.168/32 -p tcp -m tcp --dport 22 -m owner --uid-owner vnc -j REJECT --reject-with icmp-port-unreachable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment