我的公司使用非常严格的代理服务器,阻止我连接到远程服务器进行SSH操作,因此无法使用Github。我在过去的一天里尝试了网上的一些示例,如下所示:
- 如何通过严格的代理服务器使用GitHub?
- http://tachang.tumblr.com/post/22265579539/using-github-through-draconian-proxies-windows-and
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
有没有人知道我做错了什么,以及我如何让这个工作起来?谢谢。