【问题标题】:Getting file error in windows using git bash使用 git bash 在 Windows 中获取文件错误
【发布时间】:2021-07-04 06:53:33
【问题描述】:

我在 Windows 中使用 git bash 将 ssh 密钥存储在 ssh 代理中并遇到此错误。

$ ssh-add ~/.ssh/id_rsa
/c/Users/abhis/.ssh/id_rsa: No such file or directory

然后我删除了 .ssh/id_rsa 并用密钥文件的名称保存了它。它奏效了。

$ ssh-add ~/[myfilename]
Identity added: [My Folder name] (email id)

为什么会这样。

【问题讨论】:

  • 这是什么意思:*然后我删除了 .ssh/id_rsa 并用密钥文件的名称保存。 * 你能改写一下以明确你的意图吗?

标签: bash git github ssh gitlab-ci


【解决方案1】:

ssh-add 询问密钥的文件名。该错误表示程序找不到名为~/.ssh/id_rsa的文件。

当您向ssh-add 提供密钥文件的实际文件名时,它按预期工作。

要使ssh-add ~/.ssh/id_rsa 工作,您应该将密钥文件放在您的~/.ssh 文件夹中并将其命名为id_rsa

【讨论】:

  • 好的,感谢您的帮助。 @cornelius 罗默
猜你喜欢
  • 1970-01-01
  • 2019-02-12
  • 1970-01-01
  • 1970-01-01
  • 2018-12-14
  • 1970-01-01
  • 2014-11-02
  • 2015-01-18
  • 1970-01-01
相关资源
最近更新 更多