程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何在跳转框后面使用 git ssh 密钥?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决如何在跳转框后面使用 git ssh 密钥??

开发过程中遇到如何在跳转框后面使用 git ssh 密钥?的问题如何解决?下面主要结合日常开发的经验,给出你关于如何在跳转框后面使用 git ssh 密钥?的解决方法建议,希望对你解决如何在跳转框后面使用 git ssh 密钥?有所启发或帮助;

我通过一个跳转框访问一个 gitlab 服务,比如

local----> jump Box ----> server with gitlab service

然后我将gitlab服务转发到本地端口

$ ssh -L 8888:<gitlab server ip>:8888 myname@<jump Box ip>

现在我可以在浏览器上访问 gitlab(http://127.0.0.1:8888) 或 git http://127.0.0.1:8888/path/to/project.git

是需要通过http方式输入密码

我已经在 gitlab 上注册了 ssh-key。如何使用 ssh 方法进行 git?


这是我的 .git/config

[remote "origin"]
    url = ssh://git@127.0.0.1:8888/path/to/project.git
    fetch = +refs/heads/*:refs/remotes/origin/*

有一个kex_exchange_IDentification: Connection closed by remote host

$ git pull
kex_exchange_IDentification: Connection closed by remote host
Connection closed by 127.0.0.1 port 8888
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ ssh -p 8888 -v git@127.0.0.1  
OpenSSH_8.6p1,OpenSSL 1.1.1k  25 Mar 2021
deBUG1: Reading configuration data /home/ebi/.ssh/config
deBUG1: Reading configuration data /etc/ssh/ssh_config
deBUG1: ConnecTing to 127.0.0.1 [127.0.0.1] port 8888.
deBUG1: Connection established.
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_rsa type 0
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_rsa-cert type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_dsa type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_dsa-cert type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ecdsa type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ecdsa-cert type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ecdsa_sk type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ecdsa_sk-cert type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ed25519 type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ed25519-cert type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ed25519_sk type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_ed25519_sk-cert type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_xmss type -1
deBUG1: IDentity @R_419_6852@ /home/ebi/.ssh/ID_xmss-cert type -1
deBUG1: Local version String SSH-2.0-OpenSSH_8.6
deBUG1: kex_exchange_IDentification: bAnner line 0: http/1.1 400 Bad request
deBUG1: kex_exchange_IDentification: bAnner line 1: Server: Nginx
deBUG1: kex_exchange_IDentification: bAnner line 2: Date: Mon,17 May 2021 11:18:50 GMT
deBUG1: kex_exchange_IDentification: bAnner line 3: Content-Type: text/HTML
deBUG1: kex_exchange_IDentification: bAnner line 4: Content-Length: 166
deBUG1: kex_exchange_IDentification: bAnner line 5: Connection: close
deBUG1: kex_exchange_IDentification: bAnner line 6: 
deBUG1: kex_exchange_IDentification: bAnner line 7: <HTML>
deBUG1: kex_exchange_IDentification: bAnner line 8: <head><title>400 Bad request</title></head>
deBUG1: kex_exchange_IDentification: bAnner line 9: <body bgcolor="white">
deBUG1: kex_exchange_IDentification: bAnner line 10: <center><h1>400 Bad request</h1></center>
deBUG1: kex_exchange_IDentification: bAnner line 11: <hr><center>Nginx</center>
deBUG1: kex_exchange_IDentification: bAnner line 12: </body>
deBUG1: kex_exchange_IDentification: bAnner line 13: </HTML>
kex_exchange_IDentification: Connection closed by remote host
Connection closed by 127.0.0.1 port 8888

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的如何在跳转框后面使用 git ssh 密钥?全部内容,希望文章能够帮你解决如何在跳转框后面使用 git ssh 密钥?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。