git SmartGIT 不要求 ssh 密钥

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21291973/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:37:52  来源:igfitidea点击:

SmartGIT does not ask for ssh key

gitauthenticationsshkeysmartgit

提问by Elmi

after switching over to a new computer I had to install SmartGIT for Windows again and now try to clone my fedorahosted.org-repository. Keys are stored C:/User/myusername/.ssh, SmartGIT comes with a clean installation and URL for cloning my repository is correct - unfortunately SmartGIT does NOT ask for the key, it just tries to connect to fedorahosted.org but then of course fails.

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

So...what could be wrong here? Where do I have to place my ssh keys so that SmartGIT finds and uses it?

那么......这里有什么问题?我必须将 ssh 密钥放在哪里,以便 SmartGIT 找到并使用它?

采纳答案by vaiomike

Was facing the same problem, as Smart Git wouldn't ask me for the SSH key location when trying to clone a repo (instead, the process would just hang..).

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

Steps to resolve (on Windows):

解决步骤(在 Windows 上):

  1. Copy ssh keys to C:/Users/MyUserName/.ssh (as they were in a different location before after generation)
  2. Clone the repository in Smart Git again, now after specifying the repository URL, it DID ask for the SSH key location (this dialog was not shown before!)
  3. Select the SSH private key (which has been converted with e.g. Putty Keygen to an OpenSSH compatible format)
  4. Voila, cloning works!
  1. 将 ssh 密钥复制到 C:/Users/MyUserName/.ssh(因为它们在生成之前位于不同的位置)
  2. 再次在 Smart Git 中克隆存储库,现在在指定存储库 URL 后,它 DID 询问 SSH 密钥位置(此对话框之前未显示!)
  3. 选择 SSH 私钥(已使用例如 Putty Keygen 转换为 OpenSSH 兼容格式)
  4. 瞧,克隆成功了!

PS: I agree Smart Git's behavior above was weird here, as it would only let u select the key location, if the keys are in the .ssh folder specified above

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

回答by Chaitsi Patel

I had same problem. select option 'Use SmartGit as SSH client' from SmartGit -> Edit-> Preference -> Authentication And it worked.

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