title: Can't connect to MongoDB with authentication enabled
body: <p>I'm running the latest MongoDB for Ubuntu 14.04</p>
  
  <ul>
  <li>I have created a user named "admin" with "userAdminAnyDatabase" role</li>
  <li>I can access databases locally and externally </li>
  <li>I can login with "admin' with SHA-SCRAM-1 </li>
  </ul>
  
  <p>When I edit to config file to restrict access only with authentication things go wrong. What happens:</p>
  
  <ol>
  <li>I uncomment "#auth = true" in the config file. </li>
  <li>I cannot access with the correct credentials of the "admin" account.</li>
  </ol>
  
  <p>Bear in mind that I do use "service mongod restart" after making changes.</p>
  
  <p>Config file for reference:</p>
  
  <pre><code># mongod.conf
  
  # for documentation of all options, see:
  #   http://docs.mongodb.org/manual/reference/configuration-options/
  
  # Where and how to store data.
  storage:
    dbPath: /var/lib/mongodb
    journal:
      enabled: true
  #  engine:
  #  mmapv1:
  #  wiredTiger:
  
  # where to write logging data.
  systemLog:
    destination: file
    logAppend: true
    path: /var/log/mongodb/mongod.log
  
  # network interfaces
  net:
    port: 27017
    bindIp: 0.0.0.0
  
  
  #processManagement:
  
  #security:
  #auth = true
  #operationProfiling:
  
  #replication:
  
  #sharding:
  
  ## Enterprise-Only Options:
  
  #auditLog:
  #snmp:
  </code></pre>
  
  <p>Snapshot of database for reference:</p>
  
  <p><a href="https://i.stack.imgur.com/o7n1O.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o7n1O.jpg" alt="Database"></a></p>
  
  <p>What's going wrong?</p>