title: Mongodb authentication not working from config file
body: <p>I am trying to enable authentication in my mongodb version v3.4.3  from the config file but it doesn't work.</p>
  
  <p>The following works:
  <code>sudo mongod --auth --port 27017 --dbpath /var/lib/mongodb</code></p>
  
  <p>I can access via authentication</p>
  
  <p>The following works as well</p>
  
  <p><code>sudo service mongod start</code>
  but only when in the config file (which is /etc/mongod.conf) I don't put authorization: enabled</p>
  
  <p>When I add authorization: enabled (as described in the documentation for that version), I can no longer launch mongod. It gives an error saying that my database folder does not exist, so I assume the config file is corrupt and it doesn't read anymore that the database folder is in /var/lib/mongodb.</p>
  
  <p>Any suggestions are appreciated.</p>
  
  <p>Here the full config file (standard config file, except that I added authorization)</p>
  
  <p>ubuntu@ip-172-31-28-105:~$ cat /etc/mongod.conf</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:
      authorization: enabled
  
  #operationProfiling:
  
  #replication:
  
  #sharding:
  
  ## Enterprise-Only Options:
  
  #auditLog:
  
  #snmp:
  </code></pre>