Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
MongoDB
(edit)
Revision as of 16:07, 25 February 2016
524 bytes added
,
16:07, 25 February 2016
→Security
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>
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version