Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Mongodb on Ubuntu 19.10. Authentication

Writer 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?

2

1 Answer

I found it out

sudo nano /etc/mongodb.conf and

  1. add auth = true
  2. 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)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy