添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Skip to main content

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.

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 [email protected]
> Hi USERNAME! You've successfully authenticated, but GitHub does not
> provide shell access.

Note : The hostname for port 443 is ssh.github.com , not github.com .

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://[email protected]:443/YOUR-USERNAME/YOUR-REPOSITORY.git

Enabling SSH connections over HTTPS

If you are able to SSH into [email protected] over port 443, you can override your SSH settings to force any connection to GitHub.com 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:

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

You can test that this works by connecting once more to GitHub.com:

$ ssh -T [email protected]
> 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 '[ssh.github.com]:443 ([140.82.112.36]:443)' can't be established.
> ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.