default: SSH auth method: private key default: Warning: Authentication failure. Retrying - vagrant

I have read kali linux in vagrant box:
and I follow this document.
but when I run up vagrant:
$ sudo vagrant up
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/util/which.rb:37: warning: Insecure world writable dir /Users/delo in PATH, mode 040777
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'Sliim/kali-linux-2.0-amd64' version '2.0.1' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (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:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
there I get the Authentication failure error.
EDIT-01
When I execute the sudo vagrant ssh, there need password:
kali ldl$ sudo vagrant ssh
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/util/which.rb:37: warning: Insecure world writable dir /Users/delo in PATH, mode 040777
vagrant#127.0.0.1's password:
vagrant#127.0.0.1's password:
the password is not vagrant, so, who can help me to know the correct password?
In my terminal I use ssh to connect it, there I can not ssh success too:
$ ssh vagrant#127.0.0.1 -2222

You can try adding the following line to your Vagrantfile to get past the Authentication failure error message.
config.ssh.insert_key = false
Perhaps the root password is toor. Found here

Related

Vagrant "Timed out while waiting for the machine to boot."

I had a previously working setup with vagrant 1.8.1 and virtualbox 5.0.22, but after upgrading to vagrant 1.8.5 and 5.1.0, i now get the dreaded "Timed out while waiting for the machine to boot."
Any options other than downgrading?
Full output:
Bringing machine 'centos7' up with 'virtualbox' provider...
==> centos7: Importing base box 'centos/7'...
==> centos7: Matching MAC address for NAT networking...
==> centos7: Checking if box 'centos/7' is up to date...
==> centos7: Setting the name of the VM: centos7-openvpn
==> centos7: Clearing any previously set network interfaces...
==> centos7: Preparing network interfaces based on configuration...
centos7: Adapter 1: nat
centos7: Adapter 2: bridged
==> centos7: Forwarding ports...
centos7: 22 (guest) => 2222 (host) (adapter 1)
==> centos7: Running 'pre-boot' VM customizations...
==> centos7: Booting VM...
==> centos7: Waiting for machine to boot. This may take a few minutes...
centos7: SSH address: 127.0.0.1:2222
centos7: SSH username: vagrant
centos7: SSH auth method: private key
centos7: Warning: Remote connection disconnect. Retrying...
centos7:
centos7: Vagrant insecure key detected. Vagrant will automatically replace
centos7: this with a newly generated keypair for better security.
centos7:
centos7: Inserting generated public key within guest...
centos7: Removing insecure key from the guest if it's present...
centos7: Key inserted! Disconnecting and reconnecting using new SSH key...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
centos7: Warning: Authentication failure. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
This is caused by bug #7610 which is already fixed in git.
You can apply the fix yourself while you wait for a new release by editing the file vagrant/plugins/guests/linux/cap/public_key.rb and appliying the following change which is described in the bug report:
diff -uNr vagrant-original/plugins/guests/linux/cap/public_key.rb vagrant/plugins/guests/linux/cap/public_key.rb
--- vagrant-original/plugins/guests/linux/cap/public_key.rb 2016-07-19 12:06:56.575045974 -0500
+++ vagrant/plugins/guests/linux/cap/public_key.rb 2016-07-19 12:07:34.303376009 -0500
## -54,6 +54,7 ##
if test -f ~/.ssh/authorized_keys; then
grep -v -x -f '#{remote_path}' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.tmp
mv ~/.ssh/authorized_keys.tmp ~/.ssh/authorized_keys
+ chmod 0600 ~/.ssh/authorized_keys
fi
rm -f '#{remote_path}'

Solution for vagrant installation

i need your help because i have to use cakebox for a project but i have some problems when i type vagrant up i get this error. I tried everything but it did not work.
Thanks in advance !
My-PC MINGW64 /A/App_LeagueUp!/cakebox (dev)
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'cakebox'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: cakebox_default_1444639086577_31058
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
My recomendation to figure out the problem is to set the
vb.gui flag to true in your Vagrantfile . add run then vagrant up. this will open the console, on a different window. It sometimes happen to me and then i reboot and everything is working fine.
If it doesnt post findings here, at least youll have more info
Try to enable virtualization from your boot menu and try it again.

Vagrant 1.7 SSH authentication failure on OSX – private key not copied to VM

First of all I know this is a duplicate issue but I battled with this issue for about 20 hours as none of other questions's answers were working for me. This is Mac OS X specific question and answer. Virtual provider was VirtualBox 4.3 and 5.0. Vagrant versions 1.7.1 and 1.7.4
This SSH authentication failure kept on happening. If I waited or exited the process I could "vagrant ssh" in without problems, using default password "vagrant". But because this SSH failure happened, it meant that the after boot -scripts were not executed either.
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 => 8000 (adapter 1)
default: 443 => 44300 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Vagrant 1.7 has this default config set to true: config.ssh.insert_key
Vagrant will automatically insert an keypair to use for SSH, replacing the default Vagrant's insecure key inside the machine if detected. link to Vagrant SSH settings
When after vagrant up I did vagrant ssh-config I could see that the private key path was ~/.vagrant.d/insecure_key – but that key was not copied to inside VM either.
The problem was in that I had somehow messed up my OS X's SSH config. This was apparent when I ran command ssh-add -l to list loaded keys in SSH agent. There was two different keys with the same path! However I cannot confirm this was the main reason for the problem as it had persisted for several days and during which I had made a few reboots.
I made a backup of .ssh folder and copied old config lines and files one by one. Another thing I did was to remove this ill-advised tip to add this line in ~/.ssh/config
Host *
ForwardAgent yes
This practice is strongly recommended against by Github:
Warning: You may be tempted to use a wildcard like Host * to just apply this setting to all SSH connections. That's not really a good idea, as you'd be sharing your local SSH keys with every server you SSH into. They won't have direct access to the keys, but they will be able to use them as you while the connection is established. You should only add servers you trust and that you intend to use with agent forwarding.
Before doing these steps I emptied ~/.vagrant.d folder to make sure I had no previously set up global configs in play. You could also uninstall Vagrant with their uninstall script and then reinstall.
Rebooted. Then I created a new SSH key.
Then vagrant provision or vagrant destroy && vagrant up. This is how I finally got this problem solved!
My solution was while Vagrant was displaying 'default: Warning: Authentication failure. Retrying...'
On my local machine grab the public ssh key and stick it into ~/.ssh/authorized_keys inside vagrant. Which allowed vagrant to ssh into the box seamlessly and continue on provisioning in my case. Wish I knew what caused the hang though. (I also deleted all traces of existing .vagrant and .vagrant.d folders before issuing vagrant up.)
cat ~/.ssh/id_rsa.pub
vagrant ssh
echo 'your-public key' >> ~/.ssh/authorized_keys (or paste it in by hand so you don't accidentally delete any existing keys)

vagrant doesn't boot up

I'm trying to boot up my VM using the 'vagrant up' command but with no success.it get some error like following:
vagrant destroy&&vagrant up
default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu1404'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: ubuntu_default_1427785207620_64334
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
default: Adapter 3: bridged
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
default: Warning: Connection refused. Retrying...
I have tried some method form here:https://laracasts.com/discuss/channels/general-discussion/homestead-doesnt-boot-up
my software information:
vagrant 1.7.2
virtualbox 4.3.26
window 8.1
anyone have idea to solve it?
It seems its a virtual box / vagrant version incompatibility issue
I uninstalled Virtual Box 4.3.14 and installed Virtual Box 4.3.12 and it worked. Basically I downgraded virtual box.
I found the answer here Vagrant Connection Refused Error

Why does Vagrant not work right out of the box on Windows 7?

Windows 7 64-bit here. Went to the Vagrant stable version downloads page. Downloaded the Windows 64-bit installer, installed using all recommended defaults, and rebooted.
Then read their Getting Started Guide. Opened a command prompt:
vagrant init hashicorp/precise32
And see the following output:
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.
OK. So far so good. Then I do:
vagrant up
And here is the output:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise32' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise32'
default: URL: https://atlas.hashicorp.com/hashicorp/precise32
==> default: Adding box 'hashicorp/precise32' (v1.0.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
default:
==> default: Successfully added box 'hashicorp/precise32' (v1.0.0) for 'virtualbox'!
==> default: Importing base box 'hashicorp/precise32'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise32' is up to date...
==> default: Setting the name of the VM: vms_default_1421176231425_15801
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Then I read the next part of the Getting Started Guide:
Now imagine every project you've ever worked on being this easy to set up.
LOL
Why am I getting this error?

Resources