[英]How to connect to a GIT remote repository with ssh and IPV6 on Windows
我有一个Windows 7安装程序,其中一段时间以来一直在使用IPv4和git。 我有一台只需要使用IPv6访问的机器。
我可以使用GIT bash进入机器:
$ ssh git@fe80::14fc:cec5:c174:d88
Last login: Sat Nov 17 14:09:53 2018 from fe80::e119:5811:40e5:becf%en8
ord2-jims14:~ git$
PuTTY也可以。
对于GIT,我尝试了多种设置遥控器的方法。
ssh://git@[fe80::14fc:cec5:c174:d88]/repos/repo.git
ssh://git@%5Bfe80%3A%3A14fc%3Acec5%3Ac174%3Ad88%5D/repos/repo.git
ssh://git@fe80::14fc:cec5:c174:d88/repos/repo.git
ssh://git@fe80%3A%3A14fc%3Acec5%3Ac174%3Ad88/repos/repo.git
结果是
$ git pull
fatal: protocol error: bad line length character: Usin
在Windows上为GIT指定IPv6 SSH URL的正确语法是什么?
使用PuTTY代理的Windows上GIT的IPv6 URL的正确语法是:
ssh://git@[fe80:14fc:cec5:c174:d88%2510]/git/test.repo
根据RFC 2732 ,冒号不是网址转义符,并且必须使用方括号。
本地接口以URL编码%2510
附加到末尾,其中使用ipconfig
找到了我的本地接口10。 %25
是网址转义的%字符。
Link-local IPv6 Address . . . . . : fe80::e119:5811:40e5:becf%10
当然,这是GIT服务器在.ssh/authorized_keys
注册.ssh/authorized_keys
的先决条件,如果从一开始就使用ssh命令行,则仍然需要此.ssh/authorized_keys
。
为了使GIT在URL上工作,在Windows上,我必须使用已注册相同公钥的PAgent(PuTTY身份验证代理)。 另外,如果我省略了接口后缀%2510
,则该URL对我%2510
,但这不符合标准。
感谢Ron Maupin !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.