切换到新计算机后,我必须再次安装 Windows 版 SmartGIT,现在尝试克隆我的 fedorahosted.org-repository。密钥存储在 C:/User/myusername/.ssh 中,SmartGIT 进行了全新安装,并且用于克隆我的存储库的 URL 是正确的 - 不幸的是 SmartGIT 并不要求密钥,它只是尝试连接到 fedorahosted.org 但当然失败了。
那么...这里可能出了什么问题?我必须将 ssh 密钥放在哪里才能让 SmartGIT 找到并使用它?
我也有同样的问题。 从 SmartGit -> 编辑 -> 首选项 -> 身份验证中选择选项“使用 SmartGit 作为 SSH 客户端” 它起作用了。
面临同样的问题,因为在尝试克隆存储库时,Smart Git 不会询问我 SSH 密钥位置(相反,该过程只会挂起......)。
解决步骤(在 Windows 上):
PS:我同意 Smart Git 上面的行为在这里很奇怪,因为它只会让你选择密钥位置,如果密钥位于上面指定的 .ssh 文件夹中
0)
ssh-add -l
cd ~/.ssh
分别。 cd %USERPROFILE%\.ssh
、sshadd ./keyOne
、...1)我在dos框中添加了一个新的遥控器
git remote add origin-github [email protected]:memyselfandi/some-project.git
2)进入Smartgit Branches视图并设置右键单击“fetch”并得到...
SSH 身份验证对话框,询问我正确的密钥。 (这与我不同,取决于存储库,而不仅仅是 id_rsa...)
(稍后您可以再次删除那个多余的分支。任务完成。)
我多年来一直使用密码身份验证,直到 GitHub 禁用它。 因此,就我而言,解决方案是编辑 .git/config 文件并将存储库 URL 从 https:// 地址更改为适当的 ssh 地址(您可以通过使用浏览器访问存储库并单击“代码”来获取此地址) “按钮,然后选择 ssh 选项。)重新启动 SmartGit 并尝试拉/推。 之后,它要求私钥。
在 Windows 上,使用
git.exe
添加主机密钥很棘手,因为它不是交互式的。
它就卡在那里:
git.exe fetch --progress --prune --recurse-submodules=no origin
The host key is not cached for this server:
git.hostname.com (port 22)
You have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 SHA256:FF0000000000000000000000000000000000000000000
If you trust this host, enter "y" to add the key to Plink's
cache and carry on connecting.
If you want to carry on connecting just once, without adding
the key to the cache, enter "n".
connection.
Store key in cache? (y/n, Return cancels connection, i for more info)
问题很明显:
FATAL ERROR: Cannot confirm a host key in batch mode
虽然可以使用
plink.exe
添加密钥:
echo y | plink.exe -ssh [email protected] "exit"