【发布时间】:2014-01-24 06:39:46
【问题描述】:
我的公司有一个严格的代理服务器,它阻止我通过 SSH 删除服务器,从而阻止我使用 github。我花了最后一天在网上学习示例,例如
- How do I use GitHub through harsh proxies?
- 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
任何人都知道我做错了什么以及如何让它发挥作用?谢谢。
【问题讨论】: