Vagrant ssh 要求输入密码

Vagrant ssh 要求输入密码

我一直在关注这个文档关于流浪者。

我安装了 VirtualBox 和 Vagrant,然后创建了一个文件夹并运行vagrant initvagrant up.当我打字时,vagrant ssh我收到了这条消息:

The private key to connect to the machine via SSH must be owned
by the user running Vagrant. This is a strict requirement from
SSH itself. Please fix the following key to be owned by the user
running Vagrant:

/media/***/Vagrant/.vagrant/machines/default/virtualbox/private_key

我读过一些与这个问题相关的文章。我想我必须将密钥添加到我的系统中或有关验证密钥的内容。但我不清楚大多数解决方案。无论如何,如果有人能为我提供解决方案,那就太好了。

此外,当我尝试从 VirtualBox UI 访问我的虚拟运行操作系统时,它会要求输入用户名和密码。但是当我设置 vagrant 和 VirtualBox 时,我没有插入任何用户名或密码。所以我不知道为什么它要求用户名和密码。

答案1

如果您尝试从 NTFS 挂载 vagrant box,则无法更改密钥文件的所有者。

如果您想在 NTFS 上挂载文件并且正在运行本地实例,您可以尝试以下对我有用的方法:

流浪停止

[删除流浪盒]

[将以下行添加到 Vagrantfile] config.ssh.insert_key=false

[** 您可能需要再次删除并克隆您的项目]

流浪者供给

此解决方案可能不适合实时实例 - 它使用默认的不安全 ssh 密钥。如果您需要更多的安全性,您也许可以在这里找到更美味的灵魂https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html

相关内容