From 1e9060a05dbcd03a75ba0bb32235d227d00fcaa6 Mon Sep 17 00:00:00 2001 From: Alexis Ben Miloud--Josselin Date: Thu, 24 Nov 2022 10:21:54 +0100 Subject: [PATCH] =?UTF-8?q?mongodb:=20Changer=20le=20mot=20de=20passe=20d?= =?UTF-8?q?=E2=80=99un=20utilisateur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HowtoMongoDB.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/HowtoMongoDB.md b/HowtoMongoDB.md index 20812d5d..30cebe87 100644 --- a/HowtoMongoDB.md +++ b/HowtoMongoDB.md @@ -193,6 +193,22 @@ $ mongo admin -u mongoAdmin -p PASSWORD Pour les accès aux base, les utilisateurs sont stockés dans la collection _system.users_ propre à chaque base. +### Changer le mot de passe d’un utilisateur + +~~~ +# apg -n1 -m23 +# mongo … +> use admin +> db.changeUserPassword("my_user", passwordPrompt()) +~~~ + +Sans _prompt_ : + +~~~ +> use admin +> db.changeUserPassword("my_user", "my_password" +~~~ + ## Utilisation ### Administration en cli