Skip to content

Commit 8266a53

Browse files
committed
DOCSP-9535 add conf file example to enable auth tutorial
1 parent 12c80ee commit 8266a53

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

source/includes/steps-create-admin-then-enable-authentication.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ title: Re-start the MongoDB instance with access control.
7474
level: 4
7575
stepnum: 4
7676
ref: restart-with-auth
77-
pre: |
77+
content: |
7878
7979
a. Shut down the :binary:`~bin.mongod` instance. For example, from
8080
the :binary:`~bin.mongo` shell, issue the following command:
@@ -85,15 +85,24 @@ pre: |
8585
8686
#. Exit the :binary:`~bin.mongo` shell.
8787
88-
#. From the terminal, re-start the :binary:`~bin.mongod` instance
89-
with the :option:`--auth <mongod --auth>` command line option or, if using a
90-
configuration file, the :setting:`security.authorization` setting.
91-
92-
action:
93-
language: sh
94-
code: |
95-
mongod --auth --port 27017 --dbpath /var/lib/mongodb
96-
post: |
88+
#. Start the :binary:`~bin.mongod` with access control enabled.
89+
90+
- If you start the :binary:`~bin.mongod` from the command line, add
91+
the :option:`--auth <mongod --auth>` command line option:
92+
93+
.. code-block:: sh
94+
95+
mongod --auth --port 27017 --dbpath /var/lib/mongodb
96+
97+
- If you start the :binary:`~bin.mongod` using a
98+
:ref:`configuration file <configuration-options>`, add the
99+
:setting:`security.authorization` configuration file setting:
100+
101+
.. code-block:: sh
102+
103+
security:
104+
authorization: enabled
105+
97106
Clients that connect to this instance must now authenticate
98107
themselves as a MongoDB user. Clients can only perform actions as
99108
determined by their assigned roles.

0 commit comments

Comments
 (0)