hashbangcode / vlad

Vlad - Vagrant LAMP Ansible Drupal
173 stars 53 forks source link

SSH identity not passed from host to guest if running Vagrant >= 1.7.0 #116

Closed dixhuit closed 9 years ago

dixhuit commented 9 years ago

Original issue title:

"ssh-add functionality no longer working after upgrade to Vagrant 1.7.1"

Steps:

  1. Upgrade to latest version of Vagrant (1.7.1)
  2. vagrant up
  3. vagrant ssh
  4. ssh-add -L
  5. Guest box will report that The agent has no identities.

I've also noticed that Sequel Pro is now asking me for the vagrant user's password (also vagrant) every time it wants to connect to a db via ssh (despite having access to Vagrant's insecure key).

Looking at Vagrant's changelog I'm guessing that this regression is related to a feature added in v1.7.0:

If the default insecure keypair is used, Vagrant will automatically replace it with a randomly generated keypair on first vagrant up. [GH-2608]

I'm gonna attempt to roll back to Vagrant 1.6.5 for now.

dixhuit commented 9 years ago

Downgraded to Vagrant 1.6.5 and I now have everything working again. That said, I did experience similar problems initially after the downgrade and it took some extra fiddling about to get things behaving:

As you can see, my original bug report could well be totally misdiagnosed :) I'll leave this open for now to see if anyone else reports anything similar - once we have more data we'll see about closing this issue or working on a fix.

iAugur commented 9 years ago

Vagrant was updated to not use the insecure key and generate a random key So you can put the following in the Vagrant file and it will act as before:

  # since 1.7.0 Vagrant uses a random generated RSA key!! we don't want this
  config.ssh.insert_key = false

see https://github.com/mitchellh/vagrant/pull/4707

dixhuit commented 9 years ago

Currently testing what happens if you add this line but are running Vagrant < 1.7.0 (I'm still running 1.6.5 due to this very issue!). Will post back with details so that we can get an appropriate fix in for this.

dixhuit commented 9 years ago

Vagrant 1.6.5 didn't seem to care so that saves us having to check the Vagrant version and possibly add a requirement for Vagrant 1.7+.

Fixed pushed, closing issue. Thanks for your help @iAugur !