How to Setup Corkscrew to Connect to Github through Draconian Proxy
- How do I use GitHub through harsh proxies?
But nothing seems to be working. Here is my ~/.ssh/config file:
ProxyCommand /usr/local/bin/corkscrew proxy02.COMPANY_NAME.com 8080 %h %p Host github.com User git Port 22 Hostname github.com IdentityFile "/Users/msnider/.ssh/id_rsa" IdentitiesOnly yes TCPKeepAlive yes Host ssh.github.com User git Port 443 Hostname ssh.github.com IdentityFile "/Users/msnider/.ssh/id_rsa" IdentitiesOnly yes TCPKeepAlive yes
This is the error message I receive when I try to
git pull --rebase:
Proxy could not open connnection to github.com: Forbidden ssh_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I get the same forbidden error when I just try to SSH to github.com, but I can ssh to ssh.github.com if I specify my identity:
ssh -i ~/.ssh/id_rsa firstname.lastname@example.org Hi mattsnider! You've successfully authenticated, but GitHub does not provide shell access. Connection to ssh.github.com closed.
There is no authentication needed to connect to the proxy server.
I have also tried setting the
https_proxy environment variables:
Anyone have an idea as to what I am doing wrong and how I can get this to work? Thanks.
One Solution collect form web for “How to Setup Corkscrew to Connect to Github through Draconian Proxy”
I have finally figured it out. My company’s proxy server blocks all communication on ports other than 80 and 443, so I cannot connect to github on port 22. I thought the examples I found on the web were to change communication from 22 to 443, but they do not.
The problem is with this section of code from all the web examples:
Host github.com User git Port 22 Hostname github.com IdentityFile "/Users/msnider/.ssh/id_rsa" IdentitiesOnly yes TCPKeepAlive yes
This says when connecting to github.com from the proxy server use the hostname github.com and port 22, which is blocked by my proxy. By changing the
github.com definition to:
Host github.com User git Port 443 Hostname ssh.github.com IdentityFile "/Users/msnider/.ssh/id_rsa" IdentitiesOnly yes TCPKeepAlive yes
I can finally connect to github.