How to Set User Name and Password for mongodb Remote Connection?

  mongodb, question

Please enter the codeI follow this tutorial to set up: …

In fact is to put the configuration filebind_ip = ..
But the egg hurts:
Ip of mongo server: 27017

Even can connect! ! And no user name and password! ! ! ! ! !
After searching for half a day, I couldn’t find an answer. It is really useful!
Is there an expert who knows the answer?
How to make my database remote access requires a password, that isIp of mongo server: 27017Such direct access is inaccessible

additional remarks

According to this tutorial: …
After I added the administrator account,
The prompt was successfully created ~ ~ but if I log in, I will find that I will log in directly! ! !

This is too unsafe ~ knowing my ip address can log into my database ~ ~


After a google search, it was found that the verification was not started, but what I saw online was basically a tutorial not 3.0.
They all said they would stay atmongodb.conf, putauth = trueYes, but mongodb for 3.0 does not have this option. Where should I modify it?

Is it above 3.X, can you read this …
I would like to make a few points here:
Enter the configuration file
vi /etc/mongod.conf
Modify`bindIp : all IP links, external links
Then add permissions to the remote database you need, such as:
use xxxx;
ThenexitExit client
Kill related processeskillall mongod
Then the authentication mode is turned on
mongod -f /etc/mongod.conf --fork --auth
You can useRobomongo.exeTry remote login
Robomongo.exeThe use of is explained in the links given.