gitlab迁移后ssh key不能使用问题

[root@iZ2zegzZ ~]# git clone **cat.git
Cloning into '_cat'...
The authenticity of host 'git.zhugelicai.com (******)' can't be established.
RSA key fingerprint is SHA256:lhZR8eSNJtQW8PA8Uro26343YFj80jFdE.
RSA key fingerprint is MD5:87:0c:e9:9:f5:d6:3d:10:8b:ea:58:91:58:2e:ca.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '*#**.com,******' (RSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

这是因为,git通过的ssh协议连接的,ssh配置必须允许git用户连接。
/etc/ssh/sshd_config设置了用户限制。
添加如下就可以了。
AllowUsers git

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。