*Below is my Vagrantfile*

# -*- mode: ruby -*-

# vi: set ft=ruby :


#Virtualbox host and vagrant host/network confs

#

Vagrant.configure("2") do |config|

  config.vm.define "slave" do |slave|

    slave.vm.box = "centos/7"

    slave.vm.hostname = "slave.ansible.com"

    slave.vm.network :private_network, ip: "192.168.99.102"

    slave.ssh.insert_key = false

    slave.vm.boot_timeout = 800

    slave.ssh.private_key_path = ["keys/id_rsa_slave"]

    slave.vm.provision "file", source: "keys/id_rsa_slave.pub", 
destination: "~/.ssh/authorized_keys"

  end


    config.vm.provider "virtualbox" do |vb|

      vb.cpus = "1"

      vb.memory = "512"

    end



*This Vagrantfile sits in the slave folder under my home directory 
(/user/gokul/slave) and under this, I have keys directory with below keys 
and appropriate permissions*


(base) Gokul:slave gokul$ ls -lt keys/

total 16

-rw-------  1 gokul  gokul   565 May 16 18:30 id_rsa_slave.pub

-rw-------  1 gokul  gokul  2590 May 16 18:30 id_rsa_slave



*Permission of the keys directory is also fine*

(base) Gokul:slave gokul$ ls -ld keys/

drwx------  4 gokul  gokul  128 May 16 18:30 keys/



*Now I run below command to get my vagrant box up*


*vagrant up*


*And it hangs at this point failing to authenticate*

==> master: Waiting for machine to boot. This may take a few minutes...

    master: SSH address: 127.0.0.1:2200

    master: SSH username: vagrant

    master: SSH auth method: private key

    master: Warning: Authentication failure. Retrying...

    master: Warning: Authentication failure. Retrying...


SSH authentication failed! This is typically caused by the public/private

keypair for the SSH user not being properly set on the guest VM. Please

verify that the guest VM is setup with the proper public key, and that

the private key path for Vagrant is setup properly as well.


*With debug enabled also I can see that it picks up the private key that 
I've asked to, however, it fails to authenticate successfully and fails 
with above error. What am I missing?*

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/vagrant/issues
Discuss: https://discuss.hashicorp.com/c/vagrant/24
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/bacbf999-2ec2-4421-abee-41db980480f9%40googlegroups.com.

Reply via email to