title: Pymongo connection timeout from remote machine
body: <p>I have a Bitnami MEAN Stack running on AWS EC2. I'm trying to connect from a remote machine using PyMongo.</p>
  
  <pre><code>from pymongo import MongoClient
  conn = MongoClient('mongodb://username:password@ec2blah.us-east-1.compute.amazonaws.com:27017/dbname')
  </code></pre>
  
  <p>but I keep getting an error along the lines of <code>pymongo.errors.ConnectionFailure: timed out</code></p>
  
  <p>I have edited <code>/opt/bitnami/mongodb/mongodb.conf</code> to supposedly allow external connections by commenting out <code>bind_ip = 127.0.0.1</code> and uncommented <code>bind_ip = 0.0.0.0</code> and all permutations of commenting/uncommenting those lines. </p>
  
  <p>I've looked over the web for about 90 minutes now trying different things but without luck! </p>