Mongodb on Ubuntu 19.10. Authentication
Andrew Henderson
I have installed mongodb on ubuntu 19.10 using apt install mongodb(because there's nothing in official documentation about ubuntu 19.10. It isn't supported or what?)
So, it installed mongodb v3.6.8 and I use systemctl start mongodb to run it BUT as I understand it mongodb command is deprecated and mongod should be used instead, am I right?
When I try sudo systemctl start mongodb, it is says "Failed to start mongod.service: Unit mongod.service not found."
All I want to do is to only allow authorized users to connect to db. But when I try adding security: authorization: disabled into /etc/mongodb.conf mongodb fails to start(As I understand it's because it only works for mongod.conf which I obviously don't have).
What should I do? How to make an auth connection using mongodb command?
21 Answer
I found it out
sudo nano /etc/mongodb.conf and
- add
auth = true - add an IP you want to give access to to 'bind_ip' or change the value to '0.0.0.0' to give access to everyone (you obviously have to create admin user before that)