title | redirect_from | intro | versions | type | topics | shortTitle | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Suspending and unsuspending users |
|
If a user leaves or moves to a different part of the company, you should remove or modify their ability to access {% data variables.location.product_location %}. |
|
how_to |
|
Manage user suspension |
If employees leave the company, you can suspend their {% data variables.product.prodname_ghe_server %} accounts to open up user licenses in your {% data variables.product.prodname_enterprise %} license while preserving the issues, comments, repositories, gists, and other data they created. Suspended users cannot sign into your instance, nor can they push or pull code.
When you suspend a user, the change takes effect immediately with no notification to the user. If the user attempts to pull or push to a repository, they'll receive this error:
$ git clone git@[hostname]:john-doe/test-repo.git
Cloning into 'test-repo'...
ERROR: Your account is suspended. Please check with
your installation administrator.
fatal: The remote end hung up unexpectedly
[!TIP] {% data variables.product.prodname_dotcom %} recommends suspending users where possible, rather than deleting their accounts.
Before suspending site administrators, you must demote them to regular users. See "AUTOTITLE."
If you use certain external authentication features, you cannot manage user suspension from the site admin dashboard or command line:
- If LDAP Sync is enabled for {% data variables.location.product_location %}, users are automatically suspended based on the scenarios that are described in "AUTOTITLE."
- If SCIM provisioning is enabled, SCIM-provisioned users must be suspended or unsuspended through your identity provider.
{% data reusables.enterprise_site_admin_settings.access-settings %}
- In the left sidebar, click Suspended users.
- A list of suspended users displays.
{% data reusables.enterprise_site_admin_settings.access-settings %} {% data reusables.enterprise_site_admin_settings.search-user %} {% data reusables.enterprise_site_admin_settings.click-user %} {% data reusables.enterprise_site_admin_settings.admin-top-tab %}
- Under "Account suspension," in the "Danger Zone" section, click Suspend.
- In the "Log reason" field, type a reason to suspend the user.
- Click Suspend.
As when suspending a user, unsuspending a user takes effect immediately. The user will not be notified.
{% data reusables.enterprise_site_admin_settings.access-settings %}
- In the left sidebar, click Suspended users.
- Click the name of the user account that you would like to unsuspend. {% data reusables.enterprise_site_admin_settings.admin-top-tab %}
- Under "Account suspension," in the "Danger Zone" section, click Unsuspend.
- In the "Log reason" field, type a reason to unsuspend the user.
- Click Unsuspend.
{% data reusables.enterprise_installation.ssh-into-instance %}
-
Run ghe-user-suspend with the username to suspend.
ghe-user-suspend USERNAME
You can create a custom message that suspended users will see when attempting to sign in.
{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %} {% data reusables.enterprise-accounts.messages-tab %}
-
To the right of "Suspended user page", click Add message.
-
In the "Suspend user message" field, type your message. You can type Markdown, or use the Markdown toolbar to style your message.
-
To see the rendered message, click Preview. {% data reusables.enterprise_site_admin_settings.save-changes %}
{% data reusables.enterprise_installation.ssh-into-instance %}
-
Run ghe-user-unsuspend with the username to unsuspend.
ghe-user-unsuspend USERNAME