mongodb 2.4 기준
vi /etc/mongodb.conf
auth = true
use admin
db.addUser({user:"adminID", pwd:"adminPW", roles:["userAdmin", "dbAdmin", "clusterAdmin", "readWrite"]})
절대 권력 계정을 하나 추가한다.
db.auth("adminID", "adminPW")
use somedb
db.addUser({user:"ID", pwd:"PW", roles:["dbAdmin", "readWrite"]})
db.auth("ID", "PW")
mongodb://ID:PW@localhost:27017/somedb
#resouce http://docs.mongodb.org/v2.4/tutorial/add-user-administrator/