Laravel Homestead挂在SSH身份验证方法上:Mac上的私钥

问题描述:

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

I can't seem to get Homestead running. It hangs at SSH auth method: private key.

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

The Homestead VM starts. I can go to VirtualBox and open the terminal window and login with vagrant:vagrant.

我不能流浪ssh,ssh vagrant@127.0.0.1:2204或ssh vagrant@127.0.0.1 -p 2204.

I can't vagrant ssh, ssh vagrant@127.0.0.1:2204 or ssh vagrant@127.0.0.1 -p 2204.

我的文件夹中都没有显示在VM中,但是VirtualBox表示它们已被映射.

None of my folders show up in the VM, but the VirtualBox says they are mapped.

每一次流浪,我都会得到:

Every time I vagrant up, I get:

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.

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

I replaced the homestead insecure private key with my key on my box. I see a lot of people get Warning: Connection timeout. Retrying..., but I don't get that far.

我在Mac 10.11.6上

I'm on a mac 10.11.6

任何帮助将不胜感激!

我今天在macOS 10.12上遇到了同样的问题,并且花了6个小时试图找到修复程序.最后,经过几次重新安装,重新启动以及反复试验后,我可以按照以下步骤以某种方式使其正常工作...

I had the same problem on macOS 10.12 today, and lost 6 hours trying to find a fix. Finally, after several reinstallations, reboots, and trial and error, I somehow got it to work by following these steps...

  1. 完全卸载并重新安装Vagrant,VirtualBox和Homestead.
  2. 确保在VirtualBox UI中关闭了homestead-7
  3. 右键单击homestead-7框,然后选择设置"
  4. 点击网络"
  5. 在应附加到NAT的适配器1"下,单击高级"
  6. 勾选电缆连接"旁边的框
  7. 保存设置,并使用vagrant up --provision
  8. 重新配置Homestead
  9. 运行vagrant reload --provision重新配置机器
  1. Completely uninstall and reinstall Vagrant, VirtualBox, and Homestead.
  2. Ensure the homestead-7 box is shut down within the VirtualBox UI
  3. Right-click the homestead-7 box, and choose Settings
  4. Click 'Network'
  5. Under 'Adapter 1', which should be attached to NAT, click 'Advanced'
  6. Tick the box beside 'Cable Connected'
  7. Save settings, and reprovision Homestead with vagrant up --provision
  8. Run vagrant reload --provision to reprovision the machine

应该的!之后,我可以进行SSH了,但是无法通过浏览器查看Homestead站点(即使我已经配置了/etc/hosts文件),但是通过Mac的简单重启似乎可以解决此问题.

That should be it! I was able to SSH in after this, but not able to view Homestead sites through the browser (even though I'd configured the /etc/hosts file), but a simple reboot of the Mac seemed to fix this.

鉴于我首先不知道到底是什么原因造成的,这可能对我的情况有些运气,但请告诉我您的情况如何.

Given I don't know what exactly caused this in the first place, this might just be a bit of luck for my case, but let me know how you get on.