3

Using SSH over the HTTPS port

 2 years ago
source link: https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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.

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

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.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK