Open the mongod.conf file in a text editor with superuser privileges. You can use nano, vim, or any other text editor of your choice. Here’s how to do it with nano:
sudo nano /etc/mongod.conf
Add or update the following lines to enable authorization: