Code Shop

A bit of Ruby, a bit of JavaScript, a bit of love...

    • Edit
    • Delete
    • Autopost

    IPTables Redis

    I needed to limit access to Redis running on port 6379 to localhost on a Linux server. Here is the code to run that. It basically disallows anyone one who is not 127.0.0.1 from access to the server.

     
    sudo iptables -A INPUT -i eth0 ! -s 127.0.0.1 -p tcp --destination-port 6379 -j DROP 
    

    This could be generalized to other services i.e MySQL, PostgresSQL, etc. but here it is.

    Tags » iptables linux redis
    • 20 May 2010
    • Views
    • 2 Comments
    • Permalink
    • Favorited 0 Times
    • Tweet

    Comments 2 Comments

    May 21, 2010
     said...
    I'm not sure about Redis, but you can also do this with TCP wrappers (hosts.allow/deny) for most daemons. I generally configure both just in case I have to take my firewall down or if I screwed up and accidentally allowed access.
    May 21, 2010
    Abhi Yerra said...
    Look at my last statement.

    Leave a Comment

  • Abhi Yerra's Posterous

    An entity composed of reality and pseudo-reality. Enjoys coding, news, history, photography.

  • About Abhi Yerra

    An entity composed of reality and pseudo-reality. Enjoys coding, news, history, photography.

  • Subscribe

    Subscribe to this posterous
    Unsubscribe
    Follow this posterous RSS
  • Follow Me

             

Theme created for Posterous by Obox