Skip to content

DOCSP-9535 add conf file example to enable auth tutorial #4027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions source/includes/steps-create-admin-then-enable-authentication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ title: Re-start the MongoDB instance with access control.
level: 4
stepnum: 4
ref: restart-with-auth
pre: |
content: |

a. Shut down the :binary:`~bin.mongod` instance. For example, from
the :binary:`~bin.mongo` shell, issue the following command:
Expand All @@ -85,15 +85,24 @@ pre: |

#. Exit the :binary:`~bin.mongo` shell.

#. From the terminal, re-start the :binary:`~bin.mongod` instance
with the :option:`--auth <mongod --auth>` command line option or, if using a
configuration file, the :setting:`security.authorization` setting.

action:
language: sh
code: |
mongod --auth --port 27017 --dbpath /var/lib/mongodb
post: |
#. Start the :binary:`~bin.mongod` with access control enabled.

- If you start the :binary:`~bin.mongod` from the command line, add
the :option:`--auth <mongod --auth>` command line option:

.. code-block:: sh

mongod --auth --port 27017 --dbpath /var/lib/mongodb

- If you start the :binary:`~bin.mongod` using a
:ref:`configuration file <configuration-options>`, add the
:setting:`security.authorization` configuration file setting:

.. code-block:: sh

security:
authorization: enabled

Clients that connect to this instance must now authenticate
themselves as a MongoDB user. Clients can only perform actions as
determined by their assigned roles.
Expand Down