Not able to connect to github repo via ssh using http proxy tunnel

安稳与你 提交于 2019-12-23 03:09:29

问题


I am behind a proxy in my college and things like ftp and ssh don't really work out of the box. I just set up git on my laptop and I configured it's proxy and I am able to push and fetch via http(s) methods.

However I want to be able to connect via ssh to my github repo. I spent a couple of hours reading workarounds online and trying to ssh into my github repo using corkscrew to tunnel the http proxy.

My ~/.ssh/config file looks something like this:

Host github.com
Hostname ssh.github.com
Port 443
ProxyCommand corkscrew proxy62.iitd.ernet.in 80 %h %p ~/.corkscrew-auth

Debugging the ssh attempt yields the following messages:

OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /home/vivek/.ssh/config
debug1: /home/vivek/.ssh/config line 1: Applying options for github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Executing proxy command: exec corkscrew proxy62.iitd.ernet.in 80 ssh.github.com 443 ~/.corkscrew-auth
debug1: permanently_drop_suid: 1000
debug1: identity file /home/vivek/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/vivek/.ssh/id_rsa-cert type -1
debug1: identity file /home/vivek/.ssh/id_dsa type -1
debug1: identity file /home/vivek/.ssh/id_dsa-cert type -1
debug1: identity file /home/vivek/.ssh/id_ecdsa type -1
debug1: identity file /home/vivek/.ssh/id_ecdsa-cert type -1
Proxy could not open connnection to ssh.github.com:  Method Not Allowed
ssh_exchange_identification: Connection closed by remote host

Since the proxy server here requires authentication, I created a corkscrew.auth file in my home directory where I put in my credentials in the form username:password.

How do I correctly set up ssh here? I think I should be able to ssh using http-proxy tunneling no matter what. I would appreciate any help.


回答1:


You should replace proxy62.iitd.ernet.in 80 with 10.10.78.62 3128. In addition, you could remove the ~/.corkscew-auth and simply stay logged into the proxy from the browser



来源:https://stackoverflow.com/questions/19069486/not-able-to-connect-to-github-repo-via-ssh-using-http-proxy-tunnel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!