You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -36,9 +36,9 @@ with only two roles – "read" and "normal" (i.e. full read/write
36
36
access). There are several tickets related to improving the
37
37
implementation of authorization within MongoDB:
38
38
39
-
:jira:`SERVER-3198`
40
-
:jira:`SERVER-7122`
41
-
:jira:`SERVER-7124`
39
+
* :issue:`SERVER-3198`
40
+
* :issue:`SERVER-7122`
41
+
* :issue:`SERVER-7124`
42
42
43
43
The admin database is special. Several administrative commands
44
44
can only run on the admin database (and so can only be run by an
@@ -59,14 +59,17 @@ Adding Users
59
59
60
60
You must either:
61
61
62
-
have added a user to the admin db before starting the server with -auth,
62
+
#. have added a user to the admin db before starting the server with
63
+
:option:`--auth <mongod --auth>`,
63
64
64
-
added the first user from a localhost connection (you cannot add the first user from a connection that is not local with respect to the `mongod` process).
65
+
#. added the first user from a localhost connection (you cannot add
66
+
the first user from a connection that is not local with respect to
67
+
the :program:`mongod` process).
65
68
66
69
.. note::
67
70
68
71
Option (2) to add a user via localhost does not work in
69
-
sharded clusters running v2.2+ due to :jira:`SERVER-6591`. If you are
72
+
sharded clusters running v2.2+ due to :issue:`SERVER-6591`. If you are
70
73
running 2.2 with a sharded cluster and want to use secure mode you
71
74
must setup the cluster and add an admin user before restarting the
72
75
cluster to run with :option:`--keyFile <mongod --keyFile>`.
@@ -163,44 +166,45 @@ Authentication on Localhost
163
166
164
167
.. versionadded:: 2.0
165
168
166
-
The trust model, in this version, dictates that that if the
167
-
user has access to running the mongo shell on localhost
168
-
(127.0.0.1) then the user has write access to add users
169
-
regardless of what authentication is enforced in the :program:`mongod`
170
-
configuration, i.e. authentication does not apply to users
171
-
logging into `mongod` on localhost.
169
+
The trust model, in this version, dictates that that if the
170
+
user has access to running the mongo shell on localhost
171
+
(127.0.0.1) then the user has write access to add users
172
+
regardless of what authentication is enforced in the :program:`mongod`
173
+
configuration, i.e. authentication does not apply to users
174
+
logging into `mongod` on localhost.
175
+
172
176
173
177
.. versionadded:: 2.2
174
178
175
-
The trust model changed for MongoDB 2.2. If :program:`mongod`
176
-
is started with the :option:`--auth <mongod --auth>` option then
177
-
authentication is applied to local users.
178
-
179
-
For example, below the user connects as a read-only user to the
180
-
test database and tries to insert a collection but cannot.
179
+
The trust model changed for MongoDB 2.2. If :program:`mongod`
180
+
is started with the :option:`--auth <mongod --auth>` option then
181
+
authentication is applied to local users.
181
182
182
-
.. code-block:: sh
183
-
184
-
$ mongo localhost/test -u readOnly -p test
185
-
186
-
.. code-block:: javascript
187
-
188
-
MongoDB shell version: 2.2.0
189
-
connecting to: localhost/test
183
+
For example, below the user connects as a read-only user to the
184
+
test database and tries to insert a collection but cannot.
0 commit comments