diff --git a/source/includes/access-create-first-user-proc.rst b/source/includes/access-create-first-user-proc.rst new file mode 100644 index 00000000000..eb08ed5e829 --- /dev/null +++ b/source/includes/access-create-first-user-proc.rst @@ -0,0 +1,9 @@ +If your MongoDB database has no users, you *must* connect to :program:`mongod` +using the :ref:`localhost exception ` +or use the :option:`--noauth ` option when starting +:program:`mongod`. In such cases, skip to Step 3 of the procedure. + +If users exist in the MongoDB database, but none of them has the +appropriate prerequisites to create a new user or you do not have access +to them, you *must* restart :program:`mongod` with the :option:`--noauth +` option. diff --git a/source/includes/access-create-user.rst b/source/includes/access-create-user.rst index 9fe265edf68..5dbefbfe87f 100644 --- a/source/includes/access-create-user.rst +++ b/source/includes/access-create-user.rst @@ -7,5 +7,4 @@ You must have the :authaction:`grantRole` :ref:`action user. If you have the :authrole:`userAdmin` or :authrole:`userAdminAnyDatabase` -role, or if you are authenticated using the :ref:`localhost exception -`, you have those actions. +role, you have those actions. diff --git a/source/tutorial/add-admin-user.txt b/source/tutorial/add-admin-user.txt index 25db5d02520..66eb35779e8 100644 --- a/source/tutorial/add-admin-user.txt +++ b/source/tutorial/add-admin-user.txt @@ -38,6 +38,11 @@ Prerequisites .. include:: /includes/access-create-user.rst +Creating the First User or First User With Appropriate Privileges +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/access-create-first-user-proc.rst + Procedure --------- diff --git a/source/tutorial/add-user-administrator.txt b/source/tutorial/add-user-administrator.txt index 0b656d0bb38..bace6ff0978 100644 --- a/source/tutorial/add-user-administrator.txt +++ b/source/tutorial/add-user-administrator.txt @@ -33,6 +33,11 @@ Prerequisites .. include:: /includes/access-create-user.rst +Creating the First User or First User With Appropriate Privileges +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/access-create-first-user-proc.rst + Procedure --------- diff --git a/source/tutorial/add-user-to-database.txt b/source/tutorial/add-user-to-database.txt index 419eecfbc6c..46c7be23308 100644 --- a/source/tutorial/add-user-to-database.txt +++ b/source/tutorial/add-user-to-database.txt @@ -59,6 +59,11 @@ user administrator, do so as described in .. include:: /includes/access-create-user.rst +Creating the First User or First User With Appropriate Privileges +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/access-create-first-user-proc.rst + Procedures ----------