问题描述
我在GitAhead的Windows 10下成功添加了远程(私有)GitLab帐户,但是在Linux openSUSE Leap 15下,我收到了“连接失败:SSL握手失败”的信息。
请注意,我可以从要添加的GitLab中的存储库中克隆,提取,获取,提交,推送存储库,我还尝试使用以下方法重置SSH握手:
$ ssh-keygen -R gitlab.mydomain.net
# Host gitlab.mydomain.net found: line 31
/home/user/.ssh/kNown_hosts updated.
Original contents retained as /home/user/.ssh/kNown_hosts.old
$ ssh git@gitlab.mydomain.net
The authenticity of host 'gitlab.mydomain.net (<IP>)' can't be established.
ECDSA key fingerprint is SHA256:**************.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.mydomain.net,<IP>' (ECDSA) to the list of kNown hosts.
Welcome to GitLab,@UserName!
Connection to gitlab.mydomain.net closed.
但是它仍然不起作用,任何人都知道是否有一些配置可以在Linux下使用吗?
谢谢
解决方法
对于初学者,请检查服务器端目录的权限。主目录以及.ssh-dir都应使用chmod 700
处理。密钥文件也是如此。
您应该以在服务器上进行无密码登录为目标。一旦可行,GitAhead应该就可以了。如果服务器端/etc/passwd
中有一个Git-Shell,请用/bin/sh
替换它,以便发送您的pubkey:在客户端上,输入ssh-copy-id -i yourprivatekeyfile somerandomgituser@ipofyourgitserver
。之后,如果成功,您可以将/etc/passwd
行重置回Git-Shell。