I have install MongoDB 7 on Linux 8 from root user.
I observed that one new user mongod created and services are running with mongod.
but i can not switch to mongod user , So i have few doubts:
Why mongod OS user automatically created when no one can log in . I mean to say what is actual purpose behind it.
Which user should be used to start and stop the database , because once i started using root manually with mongod --config <conf_file> , after that service was not staring with systemctl because few files permission changed to root.
What is the best practices for start and stop the DB
As most applications on Linux and for security reasons, there is a dedicated user and group, that is used to own files and directories of the application.
You should not be using root user to start and stop applications.
The services should be stopped and started with systemctl.
You should be reinstalling to make sure your installation is sane.