[英]ssh: connect to host x.x.x.x port 7999: Connection timed out - Git for Windows
I'm completely new working with repositories. 我是使用存储库的全新手。
I have a repository that I need to clone from BitBucket (not BitBucket.org, the company where I'm working has an Enterprise BitBucket) using Windows 10 as Operating System. 我有一个需要使用Windows 10作为操作系统从BitBucket(不是BitBucket.org,我正在工作的公司有Enterprise BitBucket)克隆的存储库。
I've followed the instructions given from Attlasian Documentation but so far I have not been able to clone the repository because of the Message in the Title : 我已经按照Attlasian文档中的说明进行了操作,但是到目前为止,由于标题中的消息,我无法克隆存储库:
ssh: connect to host x.x.x.x port 7999: Connection timed out
I've been researching, and the main reason is because I'm an under a proxy (company's proxy), so I setup the proxy as follow: 我一直在进行研究,主要原因是因为我是代理人(公司的代理人)下的代理,因此我按如下所示设置了代理:
Taken from this question - Getting git to workwith a proxy server and many more entries in StackOverflow 取自这个问题-让git与代理服务器一起使用以及StackOverflow中的更多条目
In Git Bash: 在Git Bash中:
I used the command 我用的命令
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
This command update the file .gitconfig
located in the folder %userprofile%
by adding this: 此命令通过添加以下命令来更新位于%userprofile%
文件夹中的文件.gitconfig
:
[http]
proxy = http://proxyuser:proxypwd@proxy.server.com:8080`
I have also tried the following, as some entries suggested: 我还尝试了以下方法,如某些条目所示:
[https]
proxy = http://proxyuser:proxypwd@proxy.server.com:8080`
In my PC: 在我的电脑上:
I added the http_proxy environment variable with value " http://myUser:myPass@myProxy:8080
", and also tried in many ways ( https_proxy
, HTTP_PROXY
, HTTPS_PROXY
, I was trying all of these because some question where answered by the UperCase issue or others had to add https
). 我添加了值为“ http://myUser:myPass@myProxy:8080
”的http_proxy环境变量,并且还尝试了多种方式( https_proxy
, HTTP_PROXY
, HTTPS_PROXY
,我尝试了所有这些方式,因为UperCase问题回答了某些问题或其他人必须添加https
)。 The company proxy is HTTP , but the company repository is HTTPS . 公司代理是HTTP ,但是公司存储库是HTTPS 。
Also, I contacted to the Network Manager (actually, not really sure about his position) and told me that I need to check the setup of the proxy because I'm trying to connect directly from my PC to the Host (not going through the proxy - see image), showing me this image: 另外,我与网络管理员联系(实际上,不确定他的位置),并告诉我我需要检查代理的设置,因为我正尝试直接从PC连接到主机(而不是通过主机连接)。代理-参见图片),向我显示此图片:
In order to corroborate if I am doing something wrong in any other configuration, I've made the same configuration explained in the Attlasian Documentation in my own PC (not from work) and without a proxy. 为了证实我在任何其他配置中做错了什么,我在自己的PC上(没有工作)进行了Attlasian文档中说明的相同配置,没有代理。 I could clone the repository. 我可以克隆存储库。 So, the setup of the proxy is the problem. 因此,代理服务器的设置就是问题所在。
So, I hope you can help me with this issue, I've been stuck for days researching about this, not being able to solve it. 因此,我希望您能在这个问题上为我提供帮助,因为我一直在研究这个问题几天,却无法解决它。
First you mention ssh: this has nothing to do with an https proxy. 首先,您提到ssh:这与https代理无关。
ssh is normally on port 22, so make sure your ssh url used to reference your company's BitBucket repo is: ssh通常位于端口22上,因此请确保用于引用公司BitBucket存储库的ssh网址为:
git@mycompany:myrepo.git
or:
git@mycompany:agroup/myrepo.git
if you still see mention to port 7999, check if you have a %HOME%/.ssh/config
file which would force that port on ssh connection. 如果仍然看到提到端口7999的信息,请检查是否有%HOME%/.ssh/config
文件,它将在ssh连接上强制该端口。
( HOME
is generally set to %userprofile%
) (通常将HOME
设置为%userprofile%
)
But in any case, having an https proxy should have no bearing on an internal ssh connection. 但是无论如何,拥有https代理应该与内部ssh连接无关。
Since ssh port is blocked, the OP had to use a socks proxy, following " Using a socks proxy with git for the http transport ": 由于ssh端口被阻止,OP必须遵循“ 使用带有git的袜子代理进行http传输 ”的操作, 使用袜子代理 :
ALL_PROXY=socks5://127.0.0.1:xxxx git clone https://github.com/some/one.git
It is supported by Git since Git 2.7 : 从Git 2.7开始受Git支持 :
git config http.proxy socks5://127.0.0.1:xxxx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.