Skip to content

Commit

Permalink
DOCSP-18271: Add list users page
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored and jeff-allen-mongo committed Sep 27, 2021
1 parent 487543f commit b5dcaa5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/core/security-users.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,4 @@ general, clients should connect to the sharded cluster through the

/tutorial/create-users
/tutorial/authenticate-a-user
/tutorial/list-users
42 changes: 42 additions & 0 deletions source/tutorial/list-users.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _list-users:

==========
List Users
==========

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 3
:class: singlecol

To list all users, use :binary:`~bin.mongosh` to query the
:doc:`system.users </reference/system-users-collection>` collection:

.. code-block:: sh

use admin
db.system.users.find()

.. important::

Do not modify the :doc:`system.users
</reference/system-users-collection>` collection directly. To manage
users, use the designated :ref:`user management commands
<user-management-commands>`.

To list all users of a :doc:`sharded cluster </sharding>` that were
created through a :binary:`~bin.mongos`, connect to a
:binary:`~bin.mongos` and run the preceding command. MongoDB stores
users that are created through a :binary:`~bin.mongos` in the ``admin``
database of the :term:`config servers <config server>`.

To list all :ref:`shard local users
<shard-local-users>`, connect to the respective shard directly and run
the preceding command. MongoDB stores *shard local* users in the
``admin`` database of the shard itself. These *shard local* users are
independent from the users added to the sharded cluster through a
:binary:`~bin.mongos`. *Shard local* users are local to the shard and
are inaccessible to :binary:`~bin.mongos`.

0 comments on commit b5dcaa5

Please sign in to comment.