I have a strange problem with vagrant ssh
. Similar questions, like Vagrant asks for password after SSH key update, or (vagrant & ssh) require password, or Vagrant ssh authentication failure do not help me.
So, the plot.
I have a virtual machine running Ubuntu 14.04.3. All setup was made according to this article: https://blog.engineyard.com/2014/building-a-vagrant-box.
Note: I can ssh to this virtual machine using Putty with vagrant's insecure_private_key (converted to *.ppk), which is located "C:/Users/Gino/.vagrant.d/insecure_private_key. Password is not promtped.
Then I packaged this virtual machine, init vagrant with this package and ran vagrant up
. I got "Warning: Authentication failure. Retrying...
" error. But nevertheless I could vagrant ssh
to this machine, but it asked me a password. And if I tried to ssh
to it using Putty with the necessary key (as in the first paragraph), it asked me for a password too.
I vagrant halt
ed this machine, found it in VirtualBox VM's list and ran it manually. After that I tried to ssh
to this machine using Putty with the same key and succeed - I could logon without any password.
Result of vagrant ssh-config
, if needed:
h:\VagrantBoxes\main-server32>vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "C:/Users/Gino/.vagrant.d/insecure_private_key"
IdentitiesOnly yes
LogLevel FATAL
My Vagrantfile
(it was generated automatically, almost nothing there, only a suggested line from comments was added):
Vagrant.configure(2) do |config|
config.vm.box = "vagrant-main-server32"
config.ssh.insert_key = false
end
So what's the mystery here? Why ssh
using key works without vagrant up
and fails and prompts for password with it?
Note. Another funny thing: it still can not authenticate during
vagrant up
. But if at the time when errors "authentication failure" appear I log in to vm through virtualbox, it also succeed to log in in the window withvagrant up
. And thenvagrant ssh
works.