Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.97 KB

Github SSH over HTTPS.md

File metadata and controls

48 lines (34 loc) · 1.97 KB

Github SSH over HTTPS

A solution that works from behind a corporate firewall. Once set up it's nice and easy and no passwords are required (except if you secure your RSA key with a password).

GitBash Commands

Open GitBash and execute the following commands:

eval "$(ssh-agent -s)" Start SSH Agent (also add this command to .bash_profile)

connect -H $HTTP_PROXY -d ssh.github.com 443 Check whether connection to Github over HTTPS Port 443 is generally possible

ssh-keygen -t rsa -b 4096 -C "[email protected]" Create SSH Key

ssh-add ~/.ssh/id_rsa Add SSH-Key to SSH Agent

Add Proxies to Github Config

git config --global http.proxy $HTTP_PROXY

git config --global https.proxy $HTTP_PROXY

Add SSH Key to Github

Go to Profile -> Settings -> SSH and GPG keys -> New SSH key.

Copy-Paste your Public key from ~/.ssh/id_rsa.pub

Add SSH Key to SSH-Agent permanently

Create/Edit ~/.ssh/config and add the following Host * ProxyCommand connect -H $HTTP_PROXY %h %p

# force github.com:22 to go to ssh.github.com:443 as only HTTPS port is allowed by my proxy
Host github.com
  Hostname ssh.github.com
  Port 443
  # Automatically load the RSA key for Github when the agent is started
  IdentityFile /w/.ssh/id_rsa

Load SSH-Agent automatically on GitBash startup

Add this line to ~/.bash_profile: eval "$(ssh-agent -s)"

GitBash - check whether everything works

ssh -T [email protected]


Resources