0

I've tried to wake up base VM bento/centos-67.

$ vagrant version
Installed Version: 1.8.5
Latest Version: 1.8.5

You're running an up-to-date version of Vagrant!

$ vagrant init bento/centos-6.7; vagrant up --provider virtualbox; vagrant up
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/centos-6.7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/centos-6.7' is up to date...
==> default: Setting the name of the VM: bento_default_1473166306806_14580
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...

But in the same time I can use vagrant ssh with password vagrant.

So, what's wrong?..

Linked questions: #1

(Also reported the issue to chef)

Fix

The problem is: ~/.ssh/authorized_keys file with the public key which has 644 permissions but must be 600

$ ssh vagrant@127.0.0.1 -p 2200 # use password "vagrant"
[vagrant@localhost ~]$ chmod 600 ~/.ssh/authorized_keys

Now vagrant ssh can be used without asking.

The question is why it doesn't work from the box? What's went wrong? I have teach it how to define authorized_keys file properly? oO

Maybe this related to the vagrant bug.

Community
  • 1
  • 1
Kirby
  • 2,847
  • 2
  • 32
  • 42

1 Answers1

1

It is definitely the Vagrant bug you are linking to and not the Bento box. I am the Bento box maintainer and we've dropped back to Vagrant 1.8.4 in our pipelines.

cheeseplus
  • 66
  • 2