title: Vagrant ssh promtps for password
body: <p>I have a strange problem with <code>vagrant ssh</code>. Similar questions, like <a href="https://stackoverflow.com/questions/30339840/vagrant-asks-for-password-after-ssh-key-update">Vagrant asks for password after SSH key update</a>, or <a href="https://stackoverflow.com/questions/29769587/vagrant-ssh-require-password">(vagrant &amp; ssh) require password</a>, or <a href="https://stackoverflow.com/questions/22922891/vagrant-ssh-authentication-failure">Vagrant ssh authentication failure</a> do not help me.</p>
  
  <p>So, the plot.</p>
  
  <p>I have a virtual machine running Ubuntu 14.04.3. All setup was made according to this article: <a href="https://blog.engineyard.com/2014/building-a-vagrant-box" rel="noreferrer">https://blog.engineyard.com/2014/building-a-vagrant-box</a>.</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>Then I packaged this virtual machine, init vagrant with this package and ran <code>vagrant up</code>. I got "<code>Warning: Authentication failure. Retrying...</code>" error. But nevertheless I could <code>vagrant ssh</code> to this machine, but it asked me a password. And if I tried to <code>ssh</code> to it using Putty with the necessary key (as in the first paragraph), it asked me for a password too.</p>
  
  <p>I <code>vagrant halt</code>ed this machine, found it in VirtualBox VM's list and ran it manually. After that I tried to <code>ssh</code> to this machine using Putty with the same key and succeed - I could logon without any password.</p>
  
  <p>Result of <code>vagrant ssh-config</code>, if needed:</p>
  
  <pre><code>h:\VagrantBoxes\main-server32&gt;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
  </code></pre>
  
  <p>My <code>Vagrantfile</code> (it was generated automatically, almost nothing there, only a suggested line from comments was added):</p>
  
  <pre><code>Vagrant.configure(2) do |config|
    config.vm.box = "vagrant-main-server32"
  
    config.ssh.insert_key = false
  end
  </code></pre>
  
  <p>So what's the mystery here? Why <code>ssh</code> using key works without <code>vagrant up</code> and fails and prompts for password with it?</p>
  
  <blockquote>
    <p>Note. Another funny thing: it still can not authenticate during
    <code>vagrant up</code>. 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 with <code>vagrant up</code>. And then <code>vagrant ssh</code> works.</p>
  </blockquote>