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

查看:211
本文介绍了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密钥.正确的方法是:

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天全站免登陆