title: command line authentication of mongo fails
body: <p>I am running mongo 2.2.2 on osx.</p>
  
  <p>When I do the following authentication is going fine:</p>
  
  <pre><code>$ mongo
  &gt;&gt; use admin
  &gt;&gt; db.auth("uname", "password")
  </code></pre>
  
  <p>log:</p>
  
  <pre><code>Thu Mar  7 13:51:08 [initandlisten] connection accepted from 127.0.0.1:63474 #10 (4 connections now open)
  Thu Mar  7 13:51:08 [conn10]  authenticate db: admin { authenticate: 1, nonce: "123", user: "uname", key: "456" }
  </code></pre>
  
  <p>However when I try to authenticate directly from the commandline:</p>
  
  <pre><code>$ mongo admin -u uname -p password
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Thu Mar  7 14:25:52 [initandlisten] connection accepted from 127.0.0.1:63939 #12 (5 connections now open)
  Thu Mar  7 14:25:52 [conn12]  authenticate db: admin { authenticate: 1, nonce: "789", user: "uname", key: "147" }
  Thu Mar  7 14:25:52 [conn12] auth: key mismatch uname, ns:admin
  Thu Mar  7 14:25:52 [conn12] end connection 127.0.0.1:63939 (4 connections now open)
  </code></pre>
  
  <p>Does anyone know what causes this?</p>