如何设置Corkscrew通过Draconian代理连接到Github

 我们的生活小窍门 发布于 2023-01-31 17:55

我的公司有一个严格的代理服务器阻止我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_proxyhttps_proxy环境变量:

http_proxy=http://proxy02.COMPANY_NAME.com:8080
https_proxy=http://proxy02.COMPANY_NAME.com:8080

任何人都知道我做错了什么以及如何让它发挥作用?谢谢.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有