git连接报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

在尝试通过git bash从Windows连接到Linux自建Git服务器时遇到权限问题,错误提示涉及publickey、gssapi-keyex等。解决方法是检查Windows下的.ssh目录,发现并复制公钥到Linux服务器的authorized_keys文件中,从而成功建立连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  在Linux上已经安装过git(自己搭建)了,本机(windows)想连接过去,通过git bash敲了下clone命令提示没权限:

$ git clone git@111.11.111.11:code.git
Cloning into 'code'...
The authenticity of host '111.11.111.11 (111.11.111.11)' can't be established.
ECDSA key fingerprint is SHA256:7jmL7Nrr9zJ7psJd3Zcfr4UckRNOMkgwK/ae9dsCgaw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '111.11.111.11' (ECDSA) to the list of known hosts.
git@111.11.111.11's password:
Connection closed by 111.11.111.11 port 22
fatal: Could not read from remote repository.

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

  第一次连接失败很正常,毕竟没有设置账号信息,但第二次连接敲了自己刚设置的密码,竟然一直提示没权限


 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值