Mongo setting global admin user Mar

Auth is turned off by default for Mongo. To set a global admin you need to create an admin user and turn on auth.

If you want to additionally allow external connections you can change the bind ip from that only allows for local connections.


bind_ip =
port = 27017
auth = trueuse admin
db.addUser({user: "user", pwd: "pass", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})
Bookmark and Share
blog comments powered by Disqus