Vagrant fails to ssh into the box, even though manual connection with the same key and settings works fine.
$ vagrant provision ==> default: Running provisioner: lsb_check... SSH authentication failed! This is typically caused by the public/private keypair for the SSH user not being properly set on the guest VM. Please verify that the guest VM is setup with the proper public key, and that the private key path for Vagrant is setup properly as well. $ vagrant status Current machine states: default running (virtualbox) ... $ vagrant config --get static_ip 10.11.12.101 $ vagrant ssh-config Host default HostName 127.0.0.1 User vagrant Port 2222 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile "/home/tgr/Wikimedia/vagrant/oauth/.vagrant/machines/default/virtualbox/private_key" IdentitiesOnly yes LogLevel FATAL ForwardAgent yes ForwardX11 yes $ vagrant port ... 80 (guest) => 10001 (host) 443 (guest) => 44301 (host) 22 (guest) => 2222 (host) 9200 (guest) => 9200 (host) $ ssh -i /home/tgr/Wikimedia/vagrant/oauth/.vagrant/machines/default/virtualbox/private_key -F /dev/null vagrant@10.11.12.101 exit && echo 'yes' || echo 'no' yes $ ssh -i /home/tgr/Wikimedia/vagrant/oauth/.vagrant/machines/default/virtualbox/private_key -F /dev/null -p 2222 vagrant@127.0.0.1 exit && echo 'yes' || echo 'no' yes $ ssh-keygen -lf /home/tgr/Wikimedia/vagrant/oauth/.vagrant/machines/default/virtualbox/private_key -E md5 2048 MD5:47:c5:7c:ee:e9:19:df:f7:6e:83:32:8d:10:b8:12:8f no comment (RSA)
Vagrant debug log: P4771; the relevant lines:
... INFO ssh: Attempting SSH connection... INFO ssh: Attempting to connect to SSH... INFO ssh: - Host: 127.0.0.1 INFO ssh: - Port: 2222 INFO ssh: - Username: vagrant INFO ssh: - Password? false INFO ssh: - Key Path: ["/home/tgr/Wikimedia/vagrant/oauth/.vagrant/machines/default/virtualbox/private_key"] ... D, [2017-01-19T17:00:43.555225 #23370] DEBUG -- net.ssh.authentication.session[1041dc4]: allowed methods: publickey,password D, [2017-01-19T17:00:43.555275 #23370] DEBUG -- net.ssh.authentication.methods.none[1040b40]: none failed D, [2017-01-19T17:00:43.555369 #23370] DEBUG -- net.ssh.authentication.session[1041dc4]: trying publickey D, [2017-01-19T17:00:43.555607 #23370] DEBUG -- net.ssh.authentication.agent[102cf00]: connecting to ssh-agent D, [2017-01-19T17:00:43.555695 #23370] DEBUG -- net.ssh.authentication.agent[102cf00]: sending agent request 1 len 48 D, [2017-01-19T17:00:43.556051 #23370] DEBUG -- net.ssh.authentication.agent[102cf00]: received agent packet 2 len 5 D, [2017-01-19T17:00:43.556080 #23370] DEBUG -- net.ssh.authentication.agent[102cf00]: sending agent request 11 len 0 D, [2017-01-19T17:00:43.556616 #23370] DEBUG -- net.ssh.authentication.agent[102cf00]: received agent packet 12 len 794 D, [2017-01-19T17:00:43.556963 #23370] DEBUG -- net.ssh.authentication.methods.publickey[102d34c]: trying publickey (47:c5:7c:ee:e9:19:df:f7:6e:83:32:8d:10:b8:12:8f) D, [2017-01-19T17:00:43.557064 #23370] DEBUG -- socket[109c3a0]: queueing packet nr 6 type 50 len 348 D, [2017-01-19T17:00:43.557106 #23370] DEBUG -- socket[109c3a0]: sent 372 bytes D, [2017-01-19T17:00:43.558519 #23370] DEBUG -- socket[109c3a0]: read 68 bytes D, [2017-01-19T17:00:43.558614 #23370] DEBUG -- socket[109c3a0]: received packet nr 6 type 51 len 44 D, [2017-01-19T17:00:43.558663 #23370] DEBUG -- net.ssh.authentication.session[1041dc4]: allowed methods: publickey,password E, [2017-01-19T17:00:43.558698 #23370] ERROR -- net.ssh.authentication.session[1041dc4]: all authorization methods failed (tried none, publickey) ...