Setting up authorization in Linux
Connect to the MongoDB shell:
Switch to database — admin:
Create a user by changing the Login (user) and Password (pwd) of the user:
In MongoDB, you cannot use the characters — .,@,$,:,%,",',/,\,| in the username and password, as this can cause failures and connection of the application server to MongoDB.
If a MongoDB replica set is used, you must add the cluster manager role to the user:
You need to edit the MongoDB config file to enable authorisation, run the following commands in the shell to get the location:
Edit the resulting configuration file by adding a line:
Save the changes and restart the MongoDB service:
To test, connect to the shell with authorisation:
You need to edit the Passwork configuration file — /var/www/app/config/config.ini section [mongo] specifying the login (user) and password (pwd) of the created user:
Save the changes and refresh the Passwork web interface page to test the connection with MongoDB authorisation.