bash - 使用 git bash 在 Windows 中获取文件错误
问题描述
我在 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-add
询问密钥的文件名。该错误意味着程序找不到名为~/.ssh/id_rsa
.
当您提供ssh-add
密钥文件的实际文件名时,它按预期工作。
为了ssh-add ~/.ssh/id_rsa
工作,您应该将密钥文件放在您的~/.ssh
文件夹中并将其命名为id_rsa
.
推荐阅读
- angularjs - 项目在 ng-repeat - angular-datatable 中未定义
- vb.net - VB.net 调用一个简单的 T-SQL 执行标量但没有得到结果
- c# - 从 DataGridTextColumn 获取控件而不搜索整个 DataGrid 子项
- php - 如何在 PHP 循环中基于相同的键组合数组值
- firebase - 在 firebase 数据库中创建用户
- delphi - Delphi Tchart左轴时间标签
- javascript - 在指令控制器中更改时获取过滤数组
- python - 在 Pandas 中选择任意日期子集
- javascript - 为什么只删除双循环内的偶数/奇数孩子
- search - 如果用户输入形容词,如何自动建议用户?