The documentation ( link ) says: “Specify 0 to disable localhost authentication bypass. Enabled by default” for enableLocalhostAuthBypass. But when I start mongod with -auth:
mongod --port 30xxx --dbpath=/home/dev/xxxx --auth
And then connect via localhost:
mongo --host localhost --port 30xxx myDb
And then try to do something:
> show collections Wed Aug 7 11:07:50.420 JavaScript execution failed: error: { "$err" : "not authorized for query on configuration.system.namespaces", "code" : 16550
Bzzt, no. I can connect to -u -p and run show collections .
From the docs, it really sounds like connecting through localhost will bypass auth by default. However, this is not what I see. Are the documents unclear? Am I reading this wrong?
source share