*******************
User administration
*******************

Add a user
==========

New users can navigate to your local Anaconda Repository web page and sign themselves up for an 
account, or the administrator can add them using the command line::

    anaconda-server-create-user --username "jsmith" --password "abc123DEF"  --email "jsmith@acme.com"

NOTE: Replace jsmith, abc123DEF, and jsmith@acme.com with the actual username, password, and email address of the new user.

..
    user removal instructions commented out pending https://continuumproductteam.atlassian.net/browse/AS-790

    Administrators can remove users directly from MongoDB::

        mongo binstar --eval 'db.users.remove({"username": "jsmith"})'

    NOTE: Replace jsmith with the actual username of the user you want to remove.

Resending welcome emails to new users
=====================================

To send emails Anaconda Repository must have the :ref:`email settings <repo-admin-reference-emails>` configured.

If a user reports that they did not receive their welcome email after registering on your local Anaconda Repository web page, it may have been caught in a spam filter. An administrator can regenerate and manually send this email.

Resend welcome email:

1. Log into your Anaconda repository administrative account.
2. Navigate to the following url: ``http://your.anaconda.repository:<port>/admin/resend_email/password_reset``
3. Click the "Confirmation" tab.
4. Enter the user's email address and re-generate the email template.
5. Send the email to the user.

Resetting user passwords
========================

If a user forgets their password, an administrator can request a reset link to provide to the user.

To send emails Anaconda Repository must have the :ref:`email settings <repo-admin-reference-emails>` configured.

1. Go to the following url: ``http://your.anaconda.repository:<port>/admin/resend_email/password_reset``
2. Select the "Password Reset" tab.
3. Enter the user's email address.
4. The graphical user interface will generate a password reset link.
5. Email the link to the user.

Administrators can also reset passwords without sending emails::

    anaconda-server-admin reset-password jsmith

NOTE: Replace "jsmith" with the username whose password you want to reset.
