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).
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
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTP_PROXY
Go to Profile -> Settings -> SSH and GPG keys -> New SSH key.
Copy-Paste your Public key from ~/.ssh/id_rsa.pub
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
Add this line to ~/.bash_profile:
eval "$(ssh-agent -s)"
ssh -T [email protected]
- rakhesh.com helped me immensely to figure out how to make this work
- yougg provided me with a starting point
- Github - Working with SSH Keys better way to set up SSH-Agent to auto-load Key