diff --git a/mongodb-debian.md b/mongodb-debian.md index bf34187..6b375fd 100644 --- a/mongodb-debian.md +++ b/mongodb-debian.md @@ -16,7 +16,7 @@ ``` db.createUser( { - user: "myUserAdmin", + user: "admin", pwd: passwordPrompt(), roles: [ { role: "userAdminAnyDatabase", db: "admin" }, @@ -24,4 +24,12 @@ db.createUser( ] } ) -``` \ No newline at end of file +``` +4. Add the following to `/etc/mongod.conf` to enable authentication: +``` +security: + authorization: enabled +``` +5. Restart `mongod` with `sudo systemctl restart mongod` +6. +