diff --git a/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/deleting-your-personal-account.md b/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/deleting-your-personal-account.md index 15e032bdb9..5c44dd2718 100644 --- a/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/deleting-your-personal-account.md +++ b/content/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/deleting-your-personal-account.md @@ -49,6 +49,11 @@ For more information, see the following articles. * "[AUTOTITLE](/organizations/managing-organization-settings/deleting-an-organization-account)" * "[AUTOTITLE](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/removing-yourself-from-an-organization)" +{% ifversion ghes %} +> [!NOTE] +> * You should contact an enterprise owner before deleting your account on {% data variables.product.product_name %}. +{% endif %} + ## Back up your account data Before you delete your personal account, make a copy of all repositories, private forks, wikis, issues, and pull requests owned by your account. For more information, see "[AUTOTITLE](/repositories/archiving-a-github-repository/backing-up-a-repository)." diff --git a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/deleting-users-from-your-instance.md b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/deleting-users-from-your-instance.md new file mode 100644 index 0000000000..6f9ddcbe54 --- /dev/null +++ b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/deleting-users-from-your-instance.md @@ -0,0 +1,53 @@ +--- +title: Deleting users from your instance +intro: "You can delete a user's account to permanently remove their data from {% data variables.location.product_location %}." +versions: + ghes: '*' +type: how_to +topics: + - Access management + - Enterprise + - Security + - User account +shortTitle: Delete a user +permissions: Site administrators +--- + +## What happens when I delete a user account? + +Deleting a user account removes all repositories, forks of private repositories, wikis, issues, pull requests, pages, and packages and container images owned by the user account. By deleting a user account, **you may break software projects and workflows that depend on these things.** + +Issues and pull requests the user has created and comments they've made in repositories owned by other users or organizations will not be deleted and will instead be associated with a `ghost` user account. + +Once a user account has been deleted, the username will be available for use with a different account on {% data variables.location.product_location %}. + +## When can I delete a user account? + +You cannot delete a user that is currently an organization owner. + +* **If the user is the only owner**: Transfer ownership to another person, or delete the organization. See "[AUTOTITLE](/organizations/managing-organization-settings/transferring-organization-ownership)" and "[AUTOTITLE](/organizations/managing-organization-settings/deleting-an-organization-account)." +* **If there are other owners**: Remove the user from the organization. See "[AUTOTITLE](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/removing-yourself-from-an-organization)." + +You cannot delete your own user account. If you need to delete your own user account, ask another site administrator to delete your account for you. + +## Should I delete or suspend a user account? + +{% data variables.product.prodname_dotcom %} recommends suspending users where possible, rather than deleting their accounts. Suspending user accounts on {% data variables.product.product_name %} preserves the history of resources owned by the user account, such as repositories and pull requests, and releases the licensed seat previously consumed by the user. See "[AUTOTITLE](/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/suspending-and-unsuspending-users)." + +As an alternative to deleting or suspending a user account, to stop a user's repositories being permanently removed from your enterprise you can place a legal hold on the user account. See "[Placing a legal hold on a user or organization](/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/placing-a-legal-hold-on-a-user-or-organization)." + +## Deleting a user from the site admin dashboard + +Before deleting a user account, you should consider if a backup or copy of the repositories, private forks, wikis, issues, and pull requests owned by the user account is required. See "[AUTOTITLE](/admin/backing-up-and-restoring-your-instance/configuring-backups-on-your-instance)" and "[AUTOTITLE](/repositories/archiving-a-github-repository/backing-up-a-repository)." + +{% 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 %} +1. Under "Delete account," in the "Danger Zone" section, click **Delete this account**. +1. In the "Delete account" dialog box, under "Make sure you want to do this", review the changes. To confirm, enter the username of the account to be deleted. +1. Click **Delete this account**. + +## Further reading + +* "[AUTOTITLE](/rest/enterprise-admin/users#delete-a-user)" diff --git a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/index.md b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/index.md index 739b6f763b..f0a27e358b 100644 --- a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/index.md +++ b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/index.md @@ -33,10 +33,10 @@ children: - /removing-a-member-from-your-enterprise - /managing-dormant-users - /suspending-and-unsuspending-users + - /deleting-users-from-your-instance - /placing-a-legal-hold-on-a-user-or-organization - /auditing-ssh-keys - /rebuilding-contributions-data - /enabling-guest-collaborators shortTitle: Manage users --- - diff --git a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/managing-dormant-users.md b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/managing-dormant-users.md index ac2ef4ef71..59e3aa60a2 100644 --- a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/managing-dormant-users.md +++ b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/managing-dormant-users.md @@ -41,6 +41,8 @@ Dormancy applies to both enterprise members and outside collaborators. {% ifversion ghes %} +Dormant users are not automatically suspended. Consider suspending dormant users to release license seats. See "[AUTOTITLE](/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/suspending-and-unsuspending-users)." + ## Viewing dormant users {% data reusables.enterprise-accounts.viewing-dormant-users %} diff --git a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md index 56e5c4116d..9da87156a3 100644 --- a/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md +++ b/content/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/suspending-and-unsuspending-users.md @@ -29,18 +29,17 @@ When you suspend a user, the change takes effect immediately with no notificatio ```shell $ git clone git@[hostname]:john-doe/test-repo.git Cloning into 'test-repo'... -ERROR: Your account is suspended. Please check with +ERROR: Your account is suspended. Please check with your installation administrator. fatal: The remote end hung up unexpectedly ``` Before suspending site administrators, you must demote them to regular users. For more information, see "[AUTOTITLE](/admin/user-management/managing-users-in-your-enterprise/promoting-or-demoting-a-site-administrator)." -{% tip %} - -**Note:** If [LDAP Sync is enabled](/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap#enabling-ldap-sync) for {% data variables.location.product_location %}, users are automatically suspended when they're removed from the LDAP directory server. When LDAP Sync is enabled for your instance, normal user suspension methods are disabled. - -{% endtip %} +> [!TIP] +> * If LDAP Sync is enabled for {% data variables.location.product_location %}, users are automatically suspended based on the scenarios that are described in "[AUTOTITLE](/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap#enabling-ldap-sync)." +> * A user cannot be suspended or unsuspended from the site admin dashboard or from the command line when LDAP Sync is enabled for your instance. +> * {% data variables.product.prodname_dotcom %} recommends suspending users where possible, rather than deleting their accounts. ## Viewing suspended users in the site admin dashboard