【发布时间】:2021-01-10 21:36:29
【问题描述】:
我正在使用 MacO、Virtualbox 和 vagrant。在使用vagrant ssh SSH 连接到我的VM 后,我试图运行git fetch。我不断收到错误
权限被拒绝(公钥)。
我在本地机器上生成了 ssh 密钥。并相应地将公钥添加到我的 bitbucket 中。所以,我怀疑我的 ssh 密钥有问题,我查看了很多在线解决方案并尝试了很多,但仍然无法解决问题。
但是,我注意到我在 vm 中没有 ~/.ssh/config 文件。这可能是原因吗?我对 SSH 很陌生,所以我可能在这里遗漏了一个简单而愚蠢的解决方案。
但是,在我的本地有~/.ssh/config,它包含以下内容:
Host 127.0.0.1
AddKeysToAgent yes
ForwardAgent yes
在我的 vagrantFile 中,我设置了 config.ssh.forward_agent = true
当我运行 vagrant provision 时,我收到以下错误:
The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.
【问题讨论】: