先使用命令调试ssh连接是否成功$ ssh -vvvT git@hdss7-100.host.com
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Offering public key: /c/Users/weidi/.ssh/id_rsa RSA SHA256:+B7XNfMXp2z7htcFP8cI0Cz6HhvvU4jUmajoDKDjzS0
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /c/Users/weidi/.ssh/id_dsa
debug3: no such identity: /c/Users/weidi/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /c/Users/weidi/.ssh/id_ecdsa
debug3: no such identity: /c/Users/weidi/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /c/Users/weidi/.ssh/id_ecdsa_sk
debug3: no such identity: /c/Users/weidi/.ssh/id_ecdsa_sk: No such file or directory
debug1: Trying private key: /c/Users/weidi/.ssh/id_ed25519
debug3: no such identity: /c/Users/weidi/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /c/Users/weidi/.ssh/id_ed25519_sk
debug3: no such identity: /c/Users/weidi/.ssh/id_ed25519_sk: No such file or directory
debug1: Trying private key: /c/Users/weidi/.ssh/id_xmss
debug3: no such identity: /c/Users/weidi/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
git@hdss7-100.host.com's password:
出现以上报错
debug3: no such identity: /c/Users/weidi/.ssh/id_dsa: No such file or directory
但是我已经生成了这个文件的。
.ssh文件夹权限均是正确的。
经查是因为服务器seLinux设置问题,将远程服务器的seLinux设置为disabled关闭
[root@localhost ~]# vi /etc/selinux/config
SELINUX=disabled
然后重启机器使其生效。再使用git clone就成功了。