- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我的公司有一个严苛的代理服务器,它阻止我通过 SSH 连接来删除服务器,从而阻止我使用 github。我花了最后一天时间在网络上关注示例,例如
但似乎没有任何效果。这是我的 ~/.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
任何人都知道我做错了什么以及我如何才能让它发挥作用?谢谢。
最佳答案
我终于明白了。我公司的代理服务器阻止了除 80 和 443 以外的端口上的所有通信,因此我无法通过端口 22 连接到 github。我以为我在网上找到的示例是将通信从 22 更改为 443,但他们没有。
问题出在所有网络示例中的这部分代码:
Host github.com
User git
Port 22
Hostname github.com
IdentityFile "/Users/msnider/.ssh/id_rsa"
IdentitiesOnly yes
TCPKeepAlive yes
这表示从代理服务器连接到 github.com 时使用主机名 github.com 和端口 22,这被我的代理阻止了。通过将 github.com
定义更改为:
Host github.com
User git
Port 443
Hostname ssh.github.com
IdentityFile "/Users/msnider/.ssh/id_rsa"
IdentitiesOnly yes
TCPKeepAlive yes
我终于可以连接到github了。
关于git - 如何设置 Corkscrew 通过 Draconian 代理连接到 Github,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21318535/
我尝试编写代码来使用 Java 邮件 API 发送电子邮件。当我连接到直接互联网时,该代码运行良好。但是当我通过 http 代理使用互联网时,代码不起作用。经过我所做的所有研究。我发现 Java 邮件
我要编译Corkscrew .不过我对Unix环境不是很熟悉。 以下是我尝试过的事情以及我是如何失败的。 第 1 步:我安装了 Cygwin 并从 Cygwin 终端 (mintty.exe),我尝试
我正在尝试使用 Cygwin 在 Windows 机器上编译开瓶器。现在每次我尝试配置它时,我都会收到一个错误,指出 configure: error: cannot guess build type
我正在尝试使用 Capistrano 部署我的 Rails 应用程序,但是当涉及到“git ls-remote”时,我收到以下错误: $ /usr/bin/env git ls-remote --he
我的公司有一个严苛的代理服务器,它阻止我通过 SSH 连接来删除服务器,从而阻止我使用 github。我花了最后一天时间在网络上关注示例,例如 How do I use GitHub through
我是一名优秀的程序员,十分优秀!