How to authenticate to a VM using Vagrant up?

The issue was caused because no Public key reside on the Vagrant box. One of the following two options solves the issue.

The first option is to create a new Vagrant box using Packer. Add the following snippet to the json file and build the Vagrant box.

"provisioners": [{
    "type": "shell",
    "scripts": [

The content of this vagrant script is as follows:

yum install wget -y

mkdir /home/vagrant/.ssh
wget --no-check-certificate \
    '' \
    -O /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh
chmod -R go-rwsx /home/vagrant/.ssh

The second option is to repackage (vagrant package) the Vagrant box once the following commands specified here have been run:

mkdir -p /home/vagrant/.ssh
wget --no-check-certificate -O /home/vagrant/.ssh/authorized_keys
chmod 0700 /home/vagrant/.ssh
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh

First, try: to see what vagrant private key in you machine config

$ vagrant ssh-config


$ vagrant ssh-config
Host default
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/Users/konst/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

Second, do: Change content of file insecure_private_key with content of your own system private key