Skip to main content

Использование SSH через порт HTTPS

Иногда брандмауэры отказываются в полной мере разрешать подключения по протоколу SSH. Если использование клонирования HTTPS с кэшированием учетных данных недоступно, можно попытаться выполнить клонирование с помощью SSH-подключения, выполненного через порт HTTPS. Большинство правил брандмауэра должны разрешать этот вариант, но прокси-серверы могут этому помешать.

GitHub Enterprise Server users: Accessing GitHub Enterprise Server via SSH over the HTTPS port is currently not supported.

To test if SSH over the HTTPS port is possible, run this SSH command:

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

Note: The hostname for port 443 is, not

If that worked, great! If not, you may need to follow our troubleshooting guide.

Now, to clone the repository, you can run the following command:

git clone ssh://

Enabling SSH connections over HTTPS

If you are able to SSH into over port 443, you can override your SSH settings to force any connection to to run through that server and port.

To set this in your SSH configuration file, edit the file at ~/.ssh/config, and add this section:

    Port 443
    User git

You can test that this works by connecting once more to

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

Updating known hosts

The first time you interact with GitHub after switching to port 443, you may get a warning message that the host wasn't found in known_hosts, or that it was found by another name.

> The authenticity of host '[]:443 ([]: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:
> Are you sure you want to continue connecting (yes/no/[fingerprint])?

It is safe to answer "yes" to this question, assuming that the SSH fingerprint matches one of GitHub's published fingerprints. For the list of fingerprints, see "GitHub's SSH key fingerprints."