From afc5ca6e335de3e351f2d570b35768523dea6d77 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Sat, 7 Dec 2024 20:04:56 +0000 Subject: [PATCH] Update mongodb debian --- mongodb-debian.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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. +