configuration - 如何修复在 gitlab 中创建新仓库后给出的 URL?

标签 configuration ssh gitlab

创建新项目时,在最后一步 gitlab 给我设置我的 repo 的说明,但是 repo 的 URL 不起作用。例如,要添加远程分支,我得到:

git remote add origin git@git.srv.com:root/home.git
Note:我的 gitlab 实例在一个虚拟机上运行,​​该虚拟机主机在端口 1122 上转发 SSH 的请求到虚拟机的端口22 .所以本地 gitlab 在端口 22 上到达.

给定的 URL 不起作用

插入

继续询问密码。我的 SSH 密码和我的帐户密码都不起作用:
git push -u manu master                                        
Password: 
Password: 
Password: 
Permission denied (publickey,keyboard-interactive).
fatal: The remote end hung up unexpectedly

克隆

同样在这里,不断提示输入密码:
git clone git@git.srv.com:1122/root/home.git      
Cloning into 'home'...
Password: 

修复 URL(添加协议(protocol)和端口)

如果我只是添加一个 ssh://前缀和服务器端口( :1122/ )一切正常:
git remote add manu ssh://git@git.srv.com:1122/root/home.git

最佳答案

调试这种 ssh 访问的最可靠方法是启动 sshd -d服务器上的 session 并查看输出(它是一次性调试连接)。

请注意 git@git.srv.com:root/home.git是一个使用 scp syntax 的 url ,这意味着你有 a ~/.ssh/config file ,带有一个名为 git.srv.com 的条目,它可以引用您的私钥( IdentityFile ),如 this question例如。
您还可以检查其内容以查看它是否包含正确的值(包括正确的端口)

关于configuration - 如何修复在 gitlab 中创建新仓库后给出的 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17239673/

相关文章:

configuration - 在 Emacs 中,如何阻止 nxthml 弄乱我的背景颜色?

.net - 如何更改 "Generate Method Stub"以在 VS 中抛出 NotImplementedException?

ssh - 为什么 rsync 与 Jenkins 失败

linux - 如何在aws EC2上切换到 'git'用户

linux - gitlab 管理区域出现 500 错误

gitlab - 更改 SSH 主机以进行克隆

android - 列出可用 avdname 的命令是什么

asp.net-mvc - 没有数据库的 ASP.NET MVC 角色(并且没有角色提供程序)

git - 无法通过 ssh 将私钥添加到 docker build

windows - 如何调试 Jenkins 错误消息 "could not find a suitable ssh-agent provider"?