rho*_*dee 22 virtualbox vagrant
我正在构建具有以下要求的流浪机器(Ubuntu 12.04):
我已经ssh-keygen在主机上生成了公钥/私钥(通过)并将公钥移动到authorized_keys来宾上的文件中。我尝试过无密码 SSH。
我vagrant ssh使用启用密码的 SSH 密钥键入了一些事情:
这导致我收到以下错误消息:
SSH authentication failed! This is typically caused by the public/private
keypair for the SSH user not being properly set on the guest VM. Please
verify that the guest VM is setup with the proper public key, and that
the private key path for Vagrant is setup properly as well.
Run Code Online (Sandbox Code Playgroud)
然后我尝试了无密码 ssh。
vagrant ssh
vagrant@127.0.0.1's password:
Run Code Online (Sandbox Code Playgroud)
??
我从来没有设置过流浪用户!它应该user@hostname和我设置的一样,并且可以在我在 VirtualBox 中启动 VM 时确认工作正常。
如何让私有 ssh 密钥与 vagrant 一起正常工作?对主人做什么,对客人做什么?
更新
在 VirtualBox 中,VM 处于活动状态,但除了以下问题外,我无法从 vagrant 控制台执行以下任何命令vagrant ssh:
vagrant up
vagrant halt
唯一有效的 vagrant 命令是vagrant suspend. 当我使用它时,我实际上可以通过vagrant halt. 这是输出:
$ vagrant halt
[default] Attempting graceful shutdown of VM...
SSH authentication failed! This is typically caused by the public/private
keypair for the SSH user not being properly set on the guest VM. Please
verify that the guest VM is setup with the proper public key, and that
the private key path for Vagrant is setup properly as well.
Run Code Online (Sandbox Code Playgroud)
小智 21
我正在为来到此线程的任何人添加此解决方案:
首先在主机上打开这个文件:
$ sudo vim ~/.vagrant.d/boxes/<yourbox>/include/_Vagrantfile
Run Code Online (Sandbox Code Playgroud)
验证是否config.ssh.private_key_path已设置为您的私钥文件。如果没有更新
ssh 到具有默认密码的 vagrant box
$ vagrant ssh (default pwd = ‘vagrant’]
Run Code Online (Sandbox Code Playgroud)
一旦进入盒子:
vagrant@lucid64:~$ sudo visudo -f .ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
将您的公钥添加到此文件并保存文件,然后退出框
vagrant@lucid64:~$ exit
Run Code Online (Sandbox Code Playgroud)
回到本地机器
$ vagrant halt
$ vagrant up
Run Code Online (Sandbox Code Playgroud)
这对我有用
| 归档时间: |
|
| 查看次数: |
43854 次 |
| 最近记录: |