我正在测试SSH连接以检查git中的RSA密钥.我正在代理服务器上工作.我正在使用Windows 7并安装了msysGit-fullinstall-1.7.3.1-preview20101002.现在在msys.exe窗口中,我已经通过命令'git config --global http.proxy http:// host:port ' 设置了代理.之后我尝试了命令'ssh git@github.com'.这给了我像'ssh:github.com这样的错误:没有与name相关的地址'
我该怎么办?
wim*_*ica 47
设置http.proxy
不适用于ssh.您需要代理您的ssh连接.请参阅此说明.总结一下:
开始git-cmd.bat
并创建~/.ssh/config
(notepad %home%\.ssh\config.
)
ProxyCommand /bin/connect.exe -H proxy.server.name:3128 %h %p
Host github.com
User git
Port 22
Hostname github.com
IdentityFile "C:\users\username\.ssh\id_rsa"
TCPKeepAlive yes
IdentitiesOnly yes
Host ssh.github.com
User git
Port 443
Hostname ssh.github.com
IdentityFile "C:\users\username\.ssh\id_rsa"
TCPKeepAlive yes
IdentitiesOnly yes
Run Code Online (Sandbox Code Playgroud)
(设置正确的代理主机名:端口,以及id_rsa的路径.当你使用git-bash时,在id_rsa的路径中使用斜杠)
(我的msysgit版本包括connect.exe
,所以我不需要下载和编译connect.c) .这里也提供了预编译的exe .
现在ssh github.com
应该工作
请注意,如果要通过socks5代理连接,请更改-H
为-S
.
ProxyCommand connect -S proxy.server.name:1080 %h %p
Run Code Online (Sandbox Code Playgroud)
如果使用Linux文件系统,则文件权限~/.ssh/config
必须为600,但在标准NTFS Windows分区上,这些权限不存在.
如果您的代理需要NTLM身份验证,则可以使用cntlm,另请参阅此答案.
Ian*_*han -2
您的代理需要密码吗?那么可能就是这样了。
export http_proxy="http://<domain>\<username>:<password>@<server>:<port>"
请参阅:如何通过 HTTP 代理从 Git 存储库中提取内容?(复制!)
归档时间: |
|
查看次数: |
22505 次 |
最近记录: |