- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
首先,我知道这是一个重复的问题,但我与这个问题斗争了大约 20 个小时,因为其他问题的答案都不适合我。这是 Mac OS X 特定的问题和答案。虚拟提供商是 VirtualBox 4.3 和 5.0。 Vagrant 版本 1.7.1 和 1.7.4
这种 SSH 身份验证失败不断发生。如果我等待或退出该过程,我可以使用默认密码“vagrant”毫无问题地“vagrant ssh”。但由于发生了这次 SSH 故障,这意味着 after boot 脚本也没有执行。
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 => 8000 (adapter 1)
default: 443 => 44300 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
最佳答案
Vagrant 1.7 将此默认配置设置为 true:config.ssh.insert_key
Vagrant 将自动插入用于 SSH 的 key 对,如果检测到,将替换机器内默认 Vagrant 的不安全 key 。 link to Vagrant SSH settings
当vagrant up之后我做了vagrant ssh-config我可以看到私钥路径是~/.vagrant.d/insecure_key> – 但该 key 也没有复制到虚拟机内部。
问题在于我不知何故弄乱了我的 OS X 的 SSH 配置。当我运行命令 ssh-add -l 列出 SSH 代理中加载的 key 时,这一点很明显。有两个不同的 key 具有相同的路径!但是我无法确认这是问题的主要原因,因为它已经持续了几天,期间我重新启动了几次。
我备份了 .ssh 文件夹,并一一复制了旧的配置行和文件。我做的另一件事是删除这个 ill-advised tip在 ~/.ssh/config
中添加此行Host *
ForwardAgent yes
这种做法是strongly recommended against by Github :
警告:您可能会想使用 Host * 等通配符来将此设置应用于所有 SSH 连接。这并不是一个好主意,因为您将与您通过 SSH 访问的每台服务器共享本地 SSH key 。他们无法直接访问 key ,但在建立连接时他们将能够像您一样使用它们。您应该只添加您信任的并且打算用于代理转发的服务器。
在执行这些步骤之前,我清空了 ~/.vagrant.d 文件夹,以确保我之前没有设置全局配置。您还可以使用其卸载脚本卸载 Vagrant,然后重新安装。
已重新启动。然后我创建了一个新的 SSH key 。
然后vagrant提供或vagrant destroy && vagrant up。 这就是我最终解决这个问题的方法!
关于macos - Vagrant 1.7 OSX 上的 SSH 身份验证失败 – 私钥未复制到虚拟机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32520921/
我是一名优秀的程序员,十分优秀!