SmartGIT 不要求 ssh 密钥

问题描述 投票:0回答:5

切换到新计算机后,我必须再次安装 Windows 版 SmartGIT,现在尝试克隆我的 fedorahosted.org-repository。密钥存储在 C:/User/myusername/.ssh 中,SmartGIT 进行了全新安装,并且用于克隆我的存储库的 URL 是正确的 - 不幸的是 SmartGIT 并不要求密钥,它只是尝试连接到 fedorahosted.org 但当然失败了。

那么...这里可能出了什么问题?我必须将 ssh 密钥放在哪里才能让 SmartGIT 找到并使用它?

git authentication ssh key smartgit
5个回答
8
投票

我也有同样的问题。 从 SmartGit -> 编辑 -> 首选项 -> 身份验证中选择选项“使用 SmartGit 作为 SSH 客户端” 它起作用了。


5
投票

面临同样的问题,因为在尝试克隆存储库时,Smart Git 不会询问我 SSH 密钥位置(相反,该过程只会挂起......)。

解决步骤(在 Windows 上):

  1. 将 ssh 密钥复制到 C:/Users/MyUserName/.ssh (因为它们在生成之前位于不同的位置)
  2. 再次在 Smart Git 中克隆存储库,现在指定存储库 URL 后,它确实要求 SSH 密钥位置(之前未显示此对话框!)
  3. 选择 SSH 私钥(已使用 Putty Keygen 等转换为 OpenSSH 兼容格式)
  4. 瞧,克隆成功了!

PS:我同意 Smart Git 上面的行为在这里很奇怪,因为它只会让你选择密钥位置,如果密钥位于上面指定的 .ssh 文件夹中


0
投票

0)

  • 确保 你的 ssh 代理已启动
  • 确保添加了您的密钥:
    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...)

(稍后您可以再次删除那个多余的分支。任务完成。)


0
投票

我多年来一直使用密码身份验证,直到 GitHub 禁用它。 因此,就我而言,解决方案是编辑 .git/config 文件并将存储库 URL 从 https:// 地址更改为适当的 ssh 地址(您可以通过使用浏览器访问存储库并单击“代码”来获取此地址) “按钮,然后选择 ssh 选项。)重新启动 SmartGit 并尝试拉/推。 之后,它要求私钥。


0
投票

在 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"
© www.soinside.com 2019 - 2024. All rights reserved.