VirtualBox 6.0.8,Vagrant 2.2.4挂在SSH身份验证方法上:私钥 [英] VirtualBox 6.0.8, Vagrant 2.2.4 Hangs on SSH auth method: private key

查看:99
本文介绍了VirtualBox 6.0.8,Vagrant 2.2.4挂在SSH身份验证方法上:私钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Vagrant的新手.为了创建一个symfony项目,我正在尝试一个合适的开发环境,但是由于某种原因,我似乎无法正常工作.我所建造的机器总是卡在"SSH身份验证方法:私钥"行中.

I am new to Vagrant. I am trying to get a suitable developement envirement in order to create a symfony project but for some reason, I can't seem to get this working. What ever machine i build i always get stuck at the "SSH auth method: private key" line.

在过去的两天里,我读了很多书,这个问题似乎是由于各种原因而发生的.我在satck溢出时尝试了所有方法,但似乎无法找出导致我的设置失败的原因.

I made a lot of reading in the past 2 days and this problem seems to happend for various reasons. I tryed everything on satck overflow but just can't seem to pin point what is causing my setup to fail.

我在装有Windows 10的笔记本电脑上.我有VirtualBox 6.0.8和Vagrant 2.2.4.

I am on my laptop that has windows 10. I have VirtualBox 6.0.8 and Vagrant 2.2.4.

我尝试了4个不同的盒子,其中包括我用Chef制作的一个盒子和一个可以正常工作的更通用的盒子(hashicorp/precise64)

I tryed 4 diffrent boxes including one I builded using Chef and a more generic box that suposidly would work (hashicorp/precise64)

所以我确信问题出在vagrantfile中.

So I am confident the problem is somewhere else that in the vagrantfile.

我的BIOS中有虚拟化处于活动状态...两次轻笑.

I have virtualization active in my BIOS ... cheked twice.

我尝试使用git控制台,带有和没有管理员权限的Windows cmd以及powershell(以防万一),并得到了相同的结果.

I tryed using the git console, the windows cmd with and without admin permission as well as powershell (Just in case) and got the same result.

ssh-config表示以下内容:

ssh-config says the following:

Host default
  HostName 127.0.0.1
  User vagrant
  Port 2200
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile "C:/Users/Utilisateur 1/.vagrant.d/insecure_private_key"
  IdentitiesOnly yes
  LogLevel FATAL

我在config部分的VirtualBox gui中检查了内容,并检查了电缆盒,并且根据我尝试的端口,端口似乎已转发2200到来宾22或转发了2222到来宾22.远端总是匹配ssh-config

I checked inside the VirtualBox gui in the config section and cable box is checked and ports seems to be forwarded 2200 to guest 22 or forwarded 2222 to guest 22 depending on the box I am trying. The farward always matched the ssh-config

即使在gui配置中选中了该框,也尝试在流浪者文件中添加cableconnected1 ...

also tryed adding the cableconnected1 in the vagrant file even if the box is checked in the gui configuration ...

config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end

我检查了insecure_private_key是否存在于正确的位置,并且确实存在C:/Users/Utilisateur 1/.vagrant.d/insecure_private_key

I checked if the insecure_private_key exists at the correct location and it does C:/Users/Utilisateur 1/.vagrant.d/insecure_private_key

我尝试使用密码身份验证代替ssh密钥,但是它也冻结了,因此我将其转回到使用ssk密钥.

I tryed using password authentification instead of ssh key but it froze as well so I turned it back to using ssk key.

我也尝试删除.ssh文件夹中的Knowhost文件,但是它什么也没做

I also tryed deleting knowhost file in the .ssh folder but it did nothing

每次我尝试使用新的东西流浪者摧毁然后流浪者--provision

Everytime i tryed something new I used vagrant destroy then vagrant up --provision

当它停滞时,我尝试在盒子内进行SSHssh vagrant@127.0.0.1 -p 2200 -i〜/.vagrant.d/insecure_private_key -o UserKnownHostsFile =/dev/null -o StrictHostKeyChecking =否-o PasswordAuthentication =否-o IdentitiesOnly = yes但这给了我ssh_exchange_identification:阅读:对等连接重置

I tryed to SSH inside the box while it was stalled ssh vagrant@127.0.0.1 -p 2200 -i ~/.vagrant.d/insecure_private_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o IdentitiesOnly=yes But that gives me ssh_exchange_identification: read: Connection reset by peer

从VB gui启动VM会给我一个黑屏,并停在同一位置

Starting the VM from the VB gui gives me a black screen and stalls at the same place

我两次卸载了VirtualBox和Vagrant,销毁并重新加载了15次以上,仍然遇到与我使用的盒子相同的错误.

I uninstalled VirtualBox and Vagrant twice, destroyed and reloaded over 15 times and still get the same error what ever box i use.

如此票价我尝试了以下方框hashicorp/precise64便当/ubuntu-18.04家园还有另外1个我删除了,不记得这个名字了所有这些杂物都被认为是有效的.

So fare I tryed the following boxes hashicorp/precise64 bento/ubuntu-18.04 Homestead And 1 other I deleted and don't remember the name All those baxes are claimed to work.

我尝试在vagrantfile中添加port_forward,因为这似乎对其他遇到相同问题的成员有所帮助,但是我最终获得了2个端口转发,但仍然停滞在同一位置...

I tryed adding the port_forward in the vagrantfile because that seemed to have helped other members with the same problem but I ended up with 2 port forwards and still stalled at the same place ...

在我的Bento/Ubuntu-18.04 VM上放一个日志无所事事--debug&> vagrant.log https://transferxl.com/08vvkdTr6YJ5B2

Heres a log vagrant up --debug &> vagrant.log on my bento/ubuntu-18.04 VM https://transferxl.com/08vvkdTr6YJ5B2

我尝试将流浪文件简化到最低程度,但这没有帮助

I tryed simplefying my vagrant file to the minimum but that did not help

此刻我的无业游民文件看起来像这样:

My vagrant file at the moment looks like this:

Vagrant.configure("2") do |config|
    #berkshelf
    config.berkshelf.enabled = true

    #box
    config.vm.box = 'bento/ubuntu-18.04'
    config.vm.network :private_network, ip: '192.168.33.200'

    #network
    config.vm.network :forwarded_port, guest: 80, host: 8080

    #chef
    chef_repo_path = './chef'

    config.vm.provision :chef_solo do |chef|
        chef.cookbooks_path = 'chef/cookbooks'
        chef.data_bags_path = 'chef/data_bags'
        chef.environments_path = 'chef/environments'
        chef.roles_path = 'chef/roles'

        chef.environment = 'vagrant'
        chef.run_list = [
            'role[webserver]'
        ]
    end

end

-编辑

在下面的评论中,斯特罗姆对此表示怀疑,以防Windows用户名中的空间是问题,我在流浪汉中添加了以下内容

As sugested by Strom in the comments bellow, in case the space in my windows username was the issu, I added the following in vagrant

config.ssh.private_key_path = ["C:/Users/Utilisateur\ 1/.vagrant.d/insecure_private_key"]
config.ssh.insert_key = true

但是又回来了

vagrant destroy
==> default: Loading Berkshelf datafile...
==> default: Sharing cookbooks with VM
==> default: Running cleanup tasks for 'berkshelf'...
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
There are errors in the configuration of this machine. Please fix
the following errors and try again:

SSH:
* `private_key_path` file must exist: C:/Users/Utilisateur\ 1/.vagrant.d/insecure_private_key

所以我将其更改为

config.ssh.private_key_path = ["~/.vagrant.d/insecure_private_key"]
config.ssh.insert_key = true

但这并不能解决我原来的问题

But it did not solve my original problem

推荐答案

经过将近4天的努力,我终于可以正常工作了……我的硬盘掉了,所以我不得不更换它并重新安装Windows和我所有的东西.我做的第一件事是再次尝试vagrant和virtualbox.它在第一次尝试时就起作用了.我怀疑这是有问题的VirtualBox和网络(意味着我的物理接口).不幸的是,这就是我能说的,因为我从来没有深究这个问题.如果像我一样,您尝试了所有操作,但仍然遇到与我相同的问题,则应查看一下您的网络.我不是要告诉您重新安装Windows……这太疯狂了……但是某个地方坏了,现在一切都按预期工作了.奇怪但真实!

After almost 4 days at this, i finally got it working ... My hard drive drop dead so I had to replace it and reinstall windows and all my stuff. First thing I did was try vagrant and virtualbox again. It worked on the first try. I suspect that there was something wrong with VirtualBox and the network (meaning my physical interfaces). Unfortunately, that's all I can say about it since I never got to the bottom of this problem. If like me, you tried everything and you still have the same problem I had, you should take a look at your network. I am not gona tell you to reinstall windows ... that would be insane ... But something somewhere was broken and now everything works as expected. Weird but true!

这篇关于VirtualBox 6.0.8,Vagrant 2.2.4挂在SSH身份验证方法上:私钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆