gitlab 5.2 可以通过http克隆和推送,但是不能通过ssh克隆或者推送 [英] gitlab 5.2 can clone and push by http, but can't clone or push by ssh

查看:34
本文介绍了gitlab 5.2 可以通过http克隆和推送,但是不能通过ssh克隆或者推送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在路由后面设置了我的 gitlab 服务器,并且我已将我的 ssh 端口映射到服务器中的 50000.gitlab的端口是50001,然后我创建了一个测试项目,尝试克隆到另一台机器上,用http就可以了.

I have setup my gitlab server behind a route, and I have mapped my ssh port to 50000 in the server. the gitlab port is 50001.Then I create a test project and try to clone it in another machine,it's ok when I use http.

git remote add origin http://myrouteaddress:50001/user/test.git

但是当我尝试使用 ssh 测试它时,它失败了

but when I try to test it use ssh, it failed with

git remote add origin ssh://git@myrouteaddress:50000/user/test.git

fatal: The remote end hung up unexpectedly

我已经用

ssh -vT git@myrouteaddress -p 50000

顺利通过了.

我通过

sudo tail -f /var/log/auth.log

并获得关注

Jun  1 12:29:22 debian sshd[24799]: Accepted publickey for git from mytestpcip port 37848 ssh2
Jun  1 12:29:22 debian sshd[24799]: pam_unix(sshd:session): session opened for user git by (uid=0)
Jun  1 12:29:22 debian sshd[24801]: Received disconnect from mytestpcip: 11: disconnected by user
Jun  1 12:29:22 debian sshd[24799]: pam_unix(sshd:session): session closed for user git

谁能告诉我原因?非常感谢!

can someone tell me the reason? Thank you very much!

推荐答案

终于找到原因了,我生成了参数错误的ssh rsa key.正确的做法是:

I finally got the reason, I have generate the ssh rsa key with wrong parameter. the right way is:

ssh-keygen -t rsa -C "email@email.com"

这篇关于gitlab 5.2 可以通过http克隆和推送,但是不能通过ssh克隆或者推送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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