Update mongodb debian

rainbow napkin 2024-12-07 19:54:52 +00:00
parent 4a620fcbb6
commit 1b3aa9d318

@ -12,4 +12,14 @@
### Hardening MongoDB ### Hardening MongoDB
1. Start mongod without authentication and drop into a shell `sudo systemctl start mongod & mongosh` 1. Start mongod without authentication and drop into a shell `sudo systemctl start mongod & mongosh`
2. Switch over to the admin database `use admin` 2. Switch over to the admin database `use admin`
3. Create the administrative user: 3. Create the administrative user:
```db.createUser(
{
user: "myUserAdmin",
pwd: passwordPrompt(), // or cleartext password
roles: [
{ role: "userAdminAnyDatabase", db: "admin" },
{ role: "readWriteAnyDatabase", db: "admin" }
]
}
)```