通过代理连接到BitBucket [英] Connect to BitBucket via proxy

查看:97
本文介绍了通过代理连接到BitBucket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hoi,

我尝试 hg拉
来自我在Bitbucket.org上的私人回购
进入Windows计算机上的本地存储库
从需要Windows身份验证的公司代理后面.

I try to hg pull
from my private repo on Bitbucket.org
into my local repo on my Windows machine
from behind the company proxy that requires Windows authentication.

  • 我找到了代理服务器和端口(IE的Internet选项)
  • 我在%USERPROFILE%
  • 中找到了设置Mercurial.ini文件
  • 我在此部分添加了此部分(信息 ):

[http_proxy]
主机= TheProxyServer:TheProxyServerPort
用户= MyWindowsLogin
passwd = MyWindowsPassword

[http_proxy]
host = TheProxyServer : TheProxyServerPort
user = MyWindowsLogin
passwd = MyWindowsPassword

这有效:

C:\ path \ to \ repo> hg pull
需要http授权
领域:Bitbucket.org HTTP
用户:

C:\path\to\repo> hg pull
http authorization required
realm: Bitbucket.org HTTP
user:

输入Bitbucket的凭据后,我得到:

after I enter the credentials of Bitbucket, I get:

寻找变化
找不到变化

searching for changes
no changes found

但是Mercurial.ini中写下密码显然是主要安全问题(由于我们的密码政策,每个月都必须更新此文件).

But writing down the password in Mercurial.ini is obviously a major security issue (besides having to update this file each month because of our password policies).

是否可以让Mercurial要求代理凭据?
还是以更安全的方式存储这些凭据?

Is it somehow possible to let Mercurial ask for the proxy credentials?
Or store these credentials in a more secure way?

我尝试使用相同的设置和SSH,但是我得到了:

I tried with the same settings and SSH, but I got this:

C:\ path \ to \ repo> hg克隆ssh://hg@bitbucket.org/ ME /repo/
运行"C:\ Program Files \ TortoiseHg \ TortoisePlink.exe" -ssh -2 hg@bitbucket.org"hg -R ME /repo/serve --stdio"

C:\path\to\repo> hg clone ssh://hg@bitbucket.org/ME/repo/
running ""C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 hg@bitbucket.org "hg -R ME/repo/ serve --stdio"

中止:远程hg没有适当的响应!

abort: no suitable response from remote hg!

和一个对话框:"PuTTY Fatal Error - Network error: Connection timed out"

出现此问题是因为Subversion可以正确处理这种情况:

This question came up because Subversion handles this situation correctly:

在Subversion servers文件中,我也指定了代理主机和端口,并且Subversion自动将其Windows身份验证发送给它.当使用代理人通过代理从网络上签出资源时,我不必在任何地方输入或写下我的凭据.

In the Subversion servers file I specify the proxy host and port too, and Subversion automagically sends my windows authentication to it. I don't have to enter nor write down my credentials anywhere when checking out source from the web via the proxy using e.g.

C:\ workingdir> svn结帐 http://okarito.googlecode.com/svn/trunk / okarito只读
... 已检出修订版5.

C:\workingdir> svn checkout http://okarito.googlecode.com/svn/trunk/ okarito-read-only
... Checked out revision 5.

提前谢谢!

Thanks in advance!
Jan

推荐答案

另一种方法是运行本地http代理,然后使用您公司的http代理进行身份验证.您可以在Cygwin下运行 cntlm 并将NTLMv2哈希安全地存储在cntlm conf文件中.然后,将http代理设置为localhost:3128,并且不要指定用户名或密码.

Another alternative is to run a local http proxy which then authenticates with your companies http proxy. You can run cntlm under Cygwin and safely store an NTLMv2 hash in the cntlm conf file. You then set you http proxy to be localhost:3128, and don't specify a username or password.

我的另一个建议是使用TortoiseHg.这将存储您的代理信息,但是我不确定它是否安全存储.

My other suggestion is to use TortoiseHg. This will store your proxy information, but I'm not sure if it's stored securely.

这篇关于通过代理连接到BitBucket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆