What's the procedure to set up username/password on mongodb?
Create an admin to create users:

&gt; use admin
&gt; ( rs.initiate() )
&gt; db.createUser({user:"siteUserAdmin",pwd:"password",roles:[{role:"userAdminAnyDatabase",db:"admin"}]})


Login as userAdmin:

$ mongo -u siteUserAdmin -p password --authenticationDatabase admin


Create an admin for the cluster:

&gt; use admin
&gt; db.createUser({user:"replSetManager",pwd:"password",roles:[{role:"clusterManager",db:"admin"}]})
&gt; db.auth(replSetManager,password)
&gt; rs.status()  -&gt; ok


Create a user that can access all databases but not admin:

&gt; use admin
&gt; var w = { user:"will", roles:["readWriteAnyDatabase"], pwd:"abc"}
&gt; db.createUser(w)


Create a user only for the test database:

&gt; use test
&gt; var a = { user:"joe", pwd:"asdf", roles:["readWrite"]}
&gt; db.createUser(a)


Many roles can be combined and you can create super admins. Information on all the built-in-roles: http://docs.mongodb.org/manual/reference/built-in-roles/

(You can build your own roles also if needed: http://docs.mongodb.org/manual/tutorial/manage-users-and-roles/#create-user-defined-role)