How to take care of the mongod.conf file?

If I modify the security lines of the mongod.conf file, I can log in without security and see the database, how could I avoid that?

After modifying mongod.conf you have to stop & start mongod (assuming you edited the file while mongod was up)
Please explain what have you tried and what is not working

1 Like

first start the service with authorization enabled then I created a new user, forgot the password and could not enter so I modified mongod.conf and in the authorization line I put disabled, and you can enter without problem, my question if mongodb allows a file of configuration allow access because it does not have some security I mean the mongod.conf file?

Or could I create another file mongod.conf and have as path another database created by another configuration file for example mongod2.conf?

thank you very much for your reply

Definitively.

You should take M103 to know more about this.

1 Like

Thanks for your answer, I will follow your advice

2 Likes