mongo_config_auth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mongo_config_auth [2019/10/18 11:04] – external edit 127.0.0.1mongo_config_auth [2019/10/30 17:29] (current) – external edit 127.0.0.1
Line 80: Line 80:
 This command will create you a user called adminDBA in database: admin (important) and grant him all rights. This command will create you a user called adminDBA in database: admin (important) and grant him all rights.
 =====Enable Authentication===== =====Enable Authentication=====
-To enable authentication you should start the Mongo in special way, as follows:+Authentication in Mongo is disabled by default. Meaning everyone can connect to the database who has access to the server. 
 +Furthermore to enable authentication it depends on the version.
  
 +To enable authentication <= 2.6: you should start the Mongo in special way, as follows:
  
 +====For Version 2.6 or less====
 <sxh bash> <sxh bash>
 ===Stop=== ===Stop===
Line 98: Line 101:
 forked process: 3931 forked process: 3931
 child process started successfully, parent exiting child process started successfully, parent exiting
 +</sxh>
 +
 +Or you can enable it in the configuration file:
 +
 +<sxh bash>
 +auth = true
 +</sxh>
 +
 +====For versions 2.8 or higher====
 +To enable authentcation > 2.6
 +You can edit the /etc/mongod.conf file as follows:
 +
 +<sxh bash>
 +security:
 +  authorization: "enabled"
 </sxh> </sxh>
  
  • mongo_config_auth.1571396697.txt.gz
  • Last modified: 2019/10/18 20:04
  • (external edit)