我的公司有一个严格的代理服务器阻止我SSH服务器删除服务器,因此阻止我使用github.我花了最后一天关注网络上的例子,比如
如何通过苛刻的代理使用GitHub?
http://tachang.tumblr.com/post/22265579539/using-github-through-draconian-proxies-windows-and
但似乎没有任何效果.这是我的〜/ .ssh/config文件:
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
这是我尝试以下时收到的错误消息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.
当我尝试SSH到github.com时,我得到了相同的禁止错误,但如果我指定了我的身份,我可以ssh到ssh.github.com:
ssh -i ~/.ssh/id_rsa git@ssh.github.com Hi mattsnider! You've successfully authenticated, but GitHub does not provide shell access. Connection to ssh.github.com closed.
无需身份验证即可连接到代理服务器.
我也尝试过设置http_proxy
和https_proxy
环境变量:
http_proxy=http://proxy02.COMPANY_NAME.com:8080 https_proxy=http://proxy02.COMPANY_NAME.com:8080
任何人都知道我做错了什么以及如何让它发挥作用?谢谢.