Skip to content

Instantly share code, notes, and snippets.

@jasonruyle
Created April 17, 2013 19:52
Show Gist options
  • Save jasonruyle/5407227 to your computer and use it in GitHub Desktop.
Save jasonruyle/5407227 to your computer and use it in GitHub Desktop.
Securing mongodb and redis on ubuntu
# Run in a shell for each service
port="6379" # REDIS Port: 6379
#port="27017" # MONGO Port: 27017
server="servername.com"
iptables -A INPUT -s $servername.com -p tcp -m tcp --dport $port -j ACCEPT
iptables -A INPUT -s localhost -p tcp -m tcp --dport $port -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport $port -j DROP
# Control your Rules with iptables -L
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment