vagrant ssh 初始登录卡住解决方案

==> localvm2: Importing base box 'bigdatavm'...
==> localvm2: Matching MAC address for NAT networking...
==> localvm2: Setting the name of the VM: localvm2
==> localvm2: Fixed port collision for 22 => 2222. Now on port 2200.
==> localvm2: Clearing any previously set network interfaces...
==> localvm2: Preparing network interfaces based on configuration...
    localvm2: Adapter 1: nat
    localvm2: Adapter 2: hostonly
==> localvm2: Forwarding ports...
    localvm2: 22 (guest) => 2200 (host) (adapter 1)
==> localvm2: Running 'pre-boot' VM customizations...
==> localvm2: Booting VM...
==> localvm2: Waiting for machine to boot. This may take a few minutes...
    localvm2: SSH address: 127.0.0.1:2200
    localvm2: SSH username: vagrant
    localvm2: SSH auth method: private key
    localvm2: Warning: Remote connection disconnect. Retrying...
    localvm2: Warning: Remote connection disconnect. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
    localvm2: Warning: Authentication failure. Retrying...
D:\bigdata>vagrant ssh-config
Host localvm1
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile D:/bigdata/.vagrant/machines/localvm1/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using.

D:\bigdata>
  1. vagrant 的私钥的地址为 D:/bigdata/.vagrant/machines/localvm1/virtualbox/private_key
    拷贝本机生成的私钥(C:\Users\Administrator\.ssh\id_rsa)到上述路径下。

  2. 通过vagrant ssh 登陆到虚拟机 并且修改虚拟机~/.ssh下的公钥文件为自己本机生成的公钥(C:\Users\Administrator\.ssh\id_rsa.pub)。

下次vagrant up就可以登陆成功了

猜你喜欢

转载自blog.csdn.net/weixin_36292503/article/details/87970291