我无法克隆或推送到我的服务器上的存储库。我有一个裸仓库,位于目录home/user/test.git中的目录user@host中, 我正在尝试通过git clone访问它。我使用ssh-add 来添加我的ssh密钥。它要求我输入密钥密码。然后我可以成功地使用ssh user@host。但是如果我尝试git clone ssh://user@host/~/test.git,则会出现以下错误:
Cloning into 'test'...
user@host: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
同样的步骤我也尝试过:
git clone ssh://user@host/home/user/test.git
git clone user@host:home/user/test.git
git clone user@host:/home/user/test.git
但都没有成功。
我猜测是 Git 凭证管理器没有识别到密钥?
服务器上的 /var/auth/log
日志显示为:
Feb 20 02:25:36 xxxxx sshd[24674]: Connection closed by authenticating user XXXX x.x.x.x port 56433 [preauth]
- Git 版本信息:
git version 2.30.1.windows.1
- Git 凭证管理器版本信息:
Git Credential Manager version 2.0.318-beta+44acfafa98 (Windows, .NET Framework 4.0.30319.42000)
git config -l
命令返回的是credential.helper=manager-core
- 我尝试在
PowerShell
和git bash
Shell 中执行命令,但结果相同 user
对该仓库具有读、执行权限