Can't ssh to vagrant VMs using the insecure private key (vagrant 1.7.2)

前端 未结 5 1307
孤街浪徒
孤街浪徒 2020-12-04 12:18

I have a cluster of 3 VMs. Here is the Vagrantfile:

 # -*- mode: ruby -*-
# vi: set ft=ruby :


hosts = {
  \"host0\" => \"192.168.33.10\",
  \"host1\" =&         


        
5条回答
  •  粉色の甜心
    2020-12-04 12:58

    When Vagrant creates a new ssh key it's saved with the default configuration below the Vagrantfile directory at .vagrant/machines/default/virtualbox/private_key.

    Using the autogenerated key you can login with that from the same directory as the Vagrantfile like this:

    ssh -i .vagrant/machines/default/virtualbox/private_key -p 2222 vagrant@localhost
    

    To learn about all details about the actual ssh configuration of a vagrant box use the vagrant ssh-config command.

    # vagrant ssh-config
    Host default
      HostName 127.0.0.1
      User vagrant
      Port 2222
      UserKnownHostsFile /dev/null
      StrictHostKeyChecking no
      PasswordAuthentication no
      IdentityFile /Users/babo/src/centos/.vagrant/machines/default/virtualbox/private_key
      IdentitiesOnly yes
      LogLevel FATAL
    

提交回复
热议问题