菜鸟在这里。我从我的 /Users/fakename/.shh
中删除了所有文件文件夹。结果是现在我无法从 beanstalk git clone 存储库。当我尝试时,我收到错误 Failed to add the host to the list of known hosts Permission denied (public key)
.我在通过 SSH 登录到 Amazon Web Services 上的 EC2 实例时也遇到了问题。
让事情恢复正常的步骤是什么?
编辑 1
我目前正在尝试生成一个新的 rsa key 对,但得到以下信息:
open /Users/fake-name/.ssh/id_rsa failed: Permission denied.
Saving the key failed: /Users/fake-name/.ssh/id_rsa.
最佳答案
您无法恢复已经丢失的 key 。
将 ~/.ssh 目录的所有权更改为您的用户
sudo chown fakename:fakename .ssh
并使用
ssh-keygen
生成一对新的 rsa key 关于恢复您的 ec2 实例,请查看 this 上的答案如果你的用户文件夹是 EBS 支持的,否则如果你是唯一的用户,你是 screwed
关于git - 无法将主机添加到已知主机列表 - 意外删除了我的 .ssh 文件夹中的所有文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19136522/