If a user leaves or moves to a different part of the company, you should remove or modify their ability to access your GitHub Enterprise instance.
If employees leave the company, you can suspend their GitHub Enterprise accounts to open up seats in your site 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
Note: If LDAP Sync is enabled for your GitHub Enterprise instance, users are automatically suspended when a user in Active Directory is disabled. When LDAP Sync is enabled for your instance, normal user suspension methods are disabled.
Suspending a user from the user admin dashboard
As a site admin, sign in to your GitHub Enterprise instance at
http(s)://[hostname]/login
.In the upper-right corner of any page, click .
In the search field, type the name of the user and click Search.
In the search results, click the name of the user.
In the left sidebar, click Admin.
Under "Account suspension," in the red Danger Zone box, click Suspend.
- Provide a reason to suspend the user.
Unsuspending a user from the user admin dashboard
As when suspending a user, unsuspending a user takes effect immediately. The user will not be notified.
As a site admin, sign in to your GitHub Enterprise instance at
http(s)://[hostname]/login
.In the upper-right corner of any page, click .
In the Site Admin settings sidebar, click Suspended users.
Click the name of the user account that you would like to unsuspend.
In the left sidebar, click Admin.
Under "Account suspension," in the red Danger Zone box, click Unsuspend.
- Provide a reason to unsuspend the user.
Suspending a user from the command line
-
As a site admin, SSH into your GitHub Enterprise instance:
ssh -p 122 admin@hostname
-
Run ghe-user-suspend with the username to suspend.
ghe-user-suspend username
Unsuspending a user from the command line
-
As a site admin, SSH into your GitHub Enterprise instance:
ssh -p 122 admin@hostname
-
Run ghe-user-unsuspend with the username to unsuspend.
ghe-user-unsuspend username