title: MongoDB - admin user not authorized
body: <p>I am trying to add authorization to my MongoDB.<br>
  I am doing all this on Linux with MongoDB 2.6.1.<br>
  My mongod.conf file is in the old compatibility format<br>
  (this is how it came with the installation).    </p>
  
  <p>1) I created admin user as described here in (3)</p>
  
  <p><a href="http://docs.mongodb.org/manual/tutorial/add-user-administrator/" rel="noreferrer">http://docs.mongodb.org/manual/tutorial/add-user-administrator/</a></p>
  
  <p>2) I then edited mongod.conf by uncommenting this line</p>
  
  <p><code>auth = true</code></p>
  
  <p>3) Finally I rebooted the mongod service and I tried to login with:</p>
  
  <p><code>/usr/bin/mongo localhost:27017/admin -u sa -p pwd</code></p>
  
  <p>4) I can connect but it says this upon connect.</p>
  
  <pre><code>MongoDB shell version: 2.6.1
  connecting to: localhost:27017/admin
  Welcome to the MongoDB shell!
  The current date/time is: Thu May 29 2014 17:47:16 GMT-0400 (EDT)
  Error while trying to show server startup warnings: not authorized on admin to execute command { getLog: "startupWarnings" }
  </code></pre>
  
  <p>5) Now it seems this <code>sa</code> user I created has no permissions at all.</p>
  
  <pre><code>root@test02:~# mc
  MongoDB shell version: 2.6.1
  connecting to: localhost:27017/admin
  Welcome to the MongoDB shell!
  The current date/time is: Thu May 29 2014 17:57:03 GMT-0400 (EDT)
  Error while trying to show server startup warnings: not authorized on admin to execute command { getLog: "startupWarnings" }
  [admin] 2014-05-29 17:57:03.011 &gt;&gt;&gt; use admin
  switched to db admin
  [admin] 2014-05-29 17:57:07.889 &gt;&gt;&gt; show collections
  2014-05-29T17:57:10.377-0400 error: {
          "$err" : "not authorized for query on admin.system.namespaces",
          "code" : 13
  } at src/mongo/shell/query.js:131
  [admin] 2014-05-29 17:57:10.378 &gt;&gt;&gt; use test
  switched to db test
  [test] 2014-05-29 17:57:13.466 &gt;&gt;&gt; show collections
  2014-05-29T17:57:15.930-0400 error: {
          "$err" : "not authorized for query on test.system.namespaces",
          "code" : 13
  } at src/mongo/shell/query.js:131
  [test] 2014-05-29 17:57:15.931 &gt;&gt;&gt;
  </code></pre>
  
  <p><em>What is the problem? I repeated this whole procedure 3 times and<br>
  I think I did it all as specified in the MongoDB docs. But it doesn't work.<br>
  I was expecting this <code>sa</code> user to be authorized to do anything so that<br>
  he can then create other users and give them more specific permissions.</em></p>