macos - Laravel Homestead 在 SSH 身份验证方法 : private key on mac 中挂起

标签 macos laravel ssh vagrant homestead

我似乎无法让 Homestead 运行。它卡在 SSH 身份验证方法:私钥。

Homestead VM 启动。我可以转到 VirtualBox 并打开终端窗口并使用 vagrant:vagrant 登录。

我不能 ssh、ssh vagrant@127.0.0.1:2204 或 ssh vagrant@127.0.0.1 -p 2204。

我的文件夹都没有出现在 VM 中,但 VirtualBox 说它们已映射。

每次我 Vagrant 时,我都会得到:

vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Fixed port collision for 80 => 8000. Now on port 2200.
==> homestead-7: Fixed port collision for 443 => 44300. Now on port 2201.
==> homestead-7: Fixed port collision for 3306 => 33060. Now on port 2202.
==> homestead-7: Fixed port collision for 5432 => 54320. Now on port 2203.
==> homestead-7: Fixed port collision for 22 => 2222. Now on port 2204.
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 2200 (host) (adapter 1)
    homestead-7: 443 (guest) => 2201 (host) (adapter 1)
    homestead-7: 3306 (guest) => 2202 (host) (adapter 1)
    homestead-7: 5432 (guest) => 2203 (host) (adapter 1)
    homestead-7: 22 (guest) => 2204 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2204
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
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.

我用我的盒子上的 key 替换了宅基地不安全的私钥。我看到很多人收到警告:连接超时。正在重试...,但我没有那么远。

我在 Mac 10.11.6 上

任何帮助将不胜感激!

最佳答案

我今天在 macOS 10.12 上遇到了同样的问题,我花了 6 个小时试图找到解决办法。最后,经过几次重新安装、重新启动和反复试验后,我按照以下步骤以某种方式让它工作......

  • 完全卸载并重新安装 Vagrant、VirtualBox 和 Homestead。
  • 确保 homestead-7框在 VirtualBox UI 中关闭
  • 右键单击 homestead-7框,然后选择设置
  • 点击“网络”
  • 在应该连接到 NAT 的“适配器 1”下,单击“高级”
  • 勾选“已连接电缆”旁边的框
  • 保存设置,并使用 vagrant up --provision 重新配置 Homestead
  • 运行 vagrant reload --provision重新配置机器

  • 应该是这样!在此之后我能够通过 SSH 进入,但无法通过浏览器查看 Homestead 站点(即使我配置了 /etc/hosts 文件),但简单的 Mac 重启似乎解决了这个问题。

    鉴于我一开始不知道究竟是什么原因导致了这种情况,这对我来说可能只是运气好,但请告诉我您的进展情况。

    关于macos - Laravel Homestead 在 SSH 身份验证方法 : private key on mac 中挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40968297/

    相关文章:

    linux - 访问远程服务器上的导出变量

    ssh - Satis - ssh2.sftp 协议(protocol)出错

    ios - Swift 5 URLRequest 授权头 : reserved, 如何设置?

    Xcode 卡在 "Installing components..."

    php - Laravel Blade {{ $variable 或 'Default Text' }} 不使用 URL

    php - 当文件大小大于 2mb 时,Laravel 文件上传失败

    javascript - 我怎样才能加快 gulp 速度?

    ssh - 无法通过云外壳重新连接到 Datalab 虚拟机

    ios - 从 CGMutablePath 中删除部分

    excel - 提取离线MAC地址