Skip to content

2.5.+ edits to 'change user password' #1376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions source/tutorial/change-user-password.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,31 @@
Change a User's Password
========================

.. versionadded:: 2.4
.. versionchanged:: 2.5.3

.. default-domain:: mongodb

To change a user's password, you must have the :authrole:`userAdmin`
role on the database that contains the definition of the user whose
password you wish to change.
Overview
--------

To update the password, pass the user's username
and the new desired password to the :method:`db.changeUserPassword()`
method.
This procedure uses the :method:`db.changeUserPassword()` method to change a
user's password.

Prerequisites
-------------

Users with :authaction:`changeOwnPassword` access on their databases can
change their own passwords.

Users with :authaction:`changeAnyPassword` access on a database can modify
the passwords for any user on that database.


Procedure
---------

To update the password, pass the user's username and the new password to the
:method:`db.changeUserPassword()` method.

.. begin-reference-example-content

Expand All @@ -26,11 +40,11 @@ method.

.. end-reference-example-content


.. note::

.. include:: /includes/fact-change-password.rst

For more about changing a user's password prior to version 2.4,
see: :doc:`Add a User to a Database
</tutorial/add-user-to-database>`.
For information on changing a user's password prior to version 2.5.3,
see :v2.4:`Change a User's Password in the v2.4 Manual
</tutorial/change-user-password>`.

.. NOTE the primary reason for the above note is that the 2.4 page includes
info on changes between 2.2 and 2.4, changes we don't want to document here.