Authentication error security

Good morning
I enabled mongo authentication by editing the /etc/mongod.conf file by adding the following piece

authorization: enabled

Because every time I reboot the machine I have to run the following command mongod -f /etc/mongod.conf
otherwise the authentication doesn’t work?

What’s wrong?

Thanks Alessio

I think you are starting your mongod manually
If you want the changes effect everytime you reboot you have to run your mongod as a service

1 Like

mongo I set it with sudo systemctl enable mongod but it doesn’t go anyway

what commands should i launch?


You enabled it but did you start?
sudo systemctl start mongod
Then check status
Before starting the service make sure you don’t have any mongod running which you might have started from command line