File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ title: Re-start the MongoDB instance with access control.
74
74
level : 4
75
75
stepnum : 4
76
76
ref : restart-with-auth
77
- pre : |
77
+ content : |
78
78
79
79
a. Shut down the :binary:`~bin.mongod` instance. For example, from
80
80
the :binary:`~bin.mongo` shell, issue the following command:
@@ -85,15 +85,24 @@ pre: |
85
85
86
86
#. Exit the :binary:`~bin.mongo` shell.
87
87
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
+
97
106
Clients that connect to this instance must now authenticate
98
107
themselves as a MongoDB user. Clients can only perform actions as
99
108
determined by their assigned roles.
You can’t perform that action at this time.
0 commit comments