Skip to main content
Publicamos atualizações frequentes em nossa documentação, e a tradução desta página ainda pode estar em andamento. Para obter as informações mais recentes, acesse a documentação em inglês. Se houver problemas com a tradução desta página, entre em contato conosco.

Esta versão do GitHub Enterprise será descontinuada em 2022-06-03. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, melhorar a segurança e novos recursos, upgrade to the latest version of GitHub Enterprise. Para ajuda com a atualização, contact GitHub Enterprise support.

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 your GitHub Enterprise Server instance.

If employees leave the company, you can suspend their GitHub Enterprise Server accounts to open up user licenses in your GitHub 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

Before suspending site administrators, you must demote them to regular users. For more information, see "Promoting or demoting a site administrator."

Note: If LDAP Sync is enabled for your GitHub Enterprise Server instance, 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.

Suspending a user from the user admin dashboard

  1. From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .

    Screenshot of the rocket ship icon for accessing site admin settings

  2. If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.

    Screenshot of "Site admin" link

  3. No campo de busca, digite o nome do usuário e clique em Search (Pesquisar). campo de pesquisa de configurações de administrador do site

  4. Nos resultados da pesquisa, clique no nome do usuário. Opções de pesquisa das configurações do administrador

  5. No canto superior direito da página, clique em Admin. Ferramentas Administrativas

  6. Na barra lateral esquerda, clique em Admin. Ferramentas Administrativas

  7. Under "Account suspension," in the red Danger Zone box, click Suspend. Suspend button

  8. Provide a reason to suspend the user. Suspend reason

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.

  1. From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .

    Screenshot of the rocket ship icon for accessing site admin settings

  2. If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.

    Screenshot of "Site admin" link

  3. In the left sidebar, click Suspended users. Suspended users tab

  4. Click the name of the user account that you would like to unsuspend. Suspended user

  5. No canto superior direito da página, clique em Admin. Ferramentas Administrativas

  6. Na barra lateral esquerda, clique em Admin. Ferramentas Administrativas

  7. Under "Account suspension," in the red Danger Zone box, click Unsuspend. Unsuspend button

  8. Provide a reason to unsuspend the user. Unsuspend reason

Suspending a user from the command line

  1. SSH em your GitHub Enterprise Server instance. Para obter mais informações, consulte "Acessar o shell administrativo (SSH)".
    $ ssh -p 122 admin@HOSTNAME
  2. Run ghe-user-suspend with the username to suspend.
    $ ghe-user-suspend username

Creating a custom message for suspended users

You can create a custom message that suspended users will see when attempting to sign in.

  1. No canto superior direito de GitHub Enterprise Server, clique na sua foto de perfil e, em seguida, clique em Configurações da empresa. "Configurações da empresa" no menu suspenso para foto do perfil em GitHub Enterprise Server

  2. Na barra lateral da conta corporativa, clique em Settings. Aba de configurações na barra lateral de contas corporativas

  3. Under " Settings", click Messages. Aba Mensagens na barra lateral de configurações corporativas

  4. Click Add message. Add message

  5. Type your message into the Suspended user message box. You can type Markdown, or use the Markdown toolbar to style your message. Suspended user message

  6. Click the Preview button under the Suspended user message field to see the rendered message. Preview button

  7. Review the rendered message. Suspended user message rendered

  8. Na parte inferior da página, clique em Save changes (Salvar alterações). Salvar alterações

Unsuspending a user from the command line

  1. SSH em your GitHub Enterprise Server instance. Para obter mais informações, consulte "Acessar o shell administrativo (SSH)".
    $ ssh -p 122 admin@HOSTNAME
  2. Run ghe-user-unsuspend with the username to unsuspend.
    $ ghe-user-unsuspend username

Further reading