authentication - Mongodb revoke acccess to connect test database -


i have ec2 instance mongodb 3.2.0 installed. have user admin access. can connect user , perform operation remotely. 1 can connect database test remote if knows ip mongo 11.11.11.11. although not able make operations, want restrict access user credentials can connect server.

first need create users , grant roles users, example:

use admin db.createuser(   {     user: "myuseradmin",     pwd: "abc123",     roles: [ { role: "useradminanydatabase", db: "admin" } ]   } ) 

then need start server --auth parameter

mongod --auth 

more information here


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -