Changes

Jump to navigation Jump to search
524 bytes added ,  16:07, 25 February 2016
Line 66: Line 66:  
== Security ==
 
== Security ==
 
To enable Client Access Control follow this steps:
 
To enable Client Access Control follow this steps:
 +
# Start the mongod service if not already running
 +
#:<pre>sudo service mongod start
 +
#:: or if runnig mongo directly:
 +
#::mongod --port 27017 --dbpath /data/db1</pre>
 
# Connect to the mongo instance without access control
 
# Connect to the mongo instance without access control
        mongo --port 27017
+
#:<pre>mongo --port 27017</pre>
 +
# Create the user administrator
 +
#:<pre>
 +
#::use admin
 +
#::db.createUser(
 +
#::{
 +
#::    user: "myUserAdmin",
 +
#::    pwd: "abc123",
 +
#::    roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
 +
#::  }
 +
#::)</pre>
 +
# Edit /etc/mongod.conf, add:
 +
#:<pre>security:
 +
#::  authorization: enabled</pre>
 +
# Restart mongo service
 +
#:<pre> sudo service mongod restart</pre>

Navigation menu