0

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
  • There is currently no Ubuntu version 19.0, so I assume that you may be referring to version 19.04. Ubuntu 19.04 reached its end of support on January 23rd, 2020. Please consider modifying your question to refer to a supported version of Ubuntu, such as 18.04, 19.10 or 20.04.
    – Ulincsys
    Apr 26, 2020 at 8:28
  • yes, sorry, I meant 19.10
    – Ilya
    Apr 27, 2020 at 0:45

1 Answer 1

0

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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .