To enable a secured authentication on the MongoDB database, perform the following steps:
- Edit the following file:
/etc/mongod.conf
- Add the following lines:
security:
authorization: enabledNote: Ensure the line is not commented (remove '#') and the indentation is correct.
- Restart MongoDB by running the following command:
As root user
systemctl restart mongod
Once MongoDB is configured, it is necessary to modify accordingly the following files: