Skip to main content
We publish frequent updates to our documentation, and translation of this page may still be in progress. For the most current information, please visit the English documentation.

Using SSH over the HTTPS port

Sometimes, firewalls refuse to allow SSH connections entirely. If using HTTPS cloning with credential caching is not an option, you can attempt to clone using an SSH connection made over the HTTPS port. Most firewall rules should allow this, but proxy servers may interfere.

Usar SSH na porta HTTPS

Às vezes, os firewalls se recusam a permitir conexões SSH completamente.

Se usar clonagem de HTTPS com armazenamento de credenciais em cache não for uma opção, experimente clonar usando uma conexão SSH na porta HTTPS.

A maioria das regras de firewall deve permitir isso, mas o servidores proxy podem interferir.

$ ssh -T -p 443 git@ssh.github.com
> Hi USERNAME! You've successfully authenticated, but GitHub does not
> provide shell access.

Usar SSH em porta HTTPS

Usuários GitHub Enterprise Server : acessar GitHub Enterprise Server via SSH por porta HTTPS atualmente não tem suporte.

Para testar se o SSH na porta HTTPS é possível, execute este comando SSH:
$ git clone ssh://git@ssh.github.com:443/YOUR-USERNAME/YOUR-REPOSITORY.git

Observação: o nome do host da porta 443 é ssh.github.com, não github.com.

Se deu certo, ótimo!

Host github.com
Hostname ssh.github.com
Port 443
User git

Caso contrário, talvez seja necessário seguir nosso guia de solução de problemas.

$ ssh -T git@github.com
> Hi USERNAME! You've successfully authenticated, but GitHub does not
> provide shell access.

Agora, para clonar o repositório, você pode executar o seguinte comando:

Habilitar conexões SSH por HTTPS

> The authenticity of host '[ssh.github.com]:443 ([140.82.112.36]:443)' can't be established.
> ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
> This host key is known by the following other names/addresses:
>     ~/.ssh/known_hosts:32: github.com
> Are you sure you want to continue connecting (yes/no/[fingerprint])?

Se você conseguir usar SSH no git@ssh.github.com na porta 443, você poderá substituir as configurações de SSH para forçar qualquer conexão ao GitHub.com a ser executada nesse servidor e nessa porta. Para definir isso em seu arquivo de configuração SSH, edite o arquivo em ~/.ssh/config e adicione esta seção: