Update mongodb debian
parent
5aedb04713
commit
afc5ca6e33
|
|
@ -16,7 +16,7 @@
|
||||||
```
|
```
|
||||||
db.createUser(
|
db.createUser(
|
||||||
{
|
{
|
||||||
user: "myUserAdmin",
|
user: "admin",
|
||||||
pwd: passwordPrompt(),
|
pwd: passwordPrompt(),
|
||||||
roles: [
|
roles: [
|
||||||
{ role: "userAdminAnyDatabase", db: "admin" },
|
{ role: "userAdminAnyDatabase", db: "admin" },
|
||||||
|
|
@ -25,3 +25,11 @@ db.createUser(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
4. Add the following to `/etc/mongod.conf` to enable authentication:
|
||||||
|
```
|
||||||
|
security:
|
||||||
|
authorization: enabled
|
||||||
|
```
|
||||||
|
5. Restart `mongod` with `sudo systemctl restart mongod`
|
||||||
|
6.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue