Created
June 1, 2015 10:21
-
-
Save ten0s/f6b4f598a46344ab0dfd to your computer and use it in GitHub Desktop.
Fix Vagrant's Authentication failure after re-building the box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> default: Waiting for machine to boot. This may take a few minutes... | |
default: SSH address: 127.0.0.1:2202 | |
default: SSH username: vagrant | |
default: SSH auth method: private key | |
default: Warning: Connection timeout. Retrying... | |
default: Warning: Remote connection disconnect. Retrying... | |
default: Warning: Authentication failure. Retrying... | |
default: Warning: Authentication failure. Retrying... | |
default: Warning: Authentication failure. Retrying... | |
$ vagrant ssh-config | |
Host default | |
HostName 127.0.0.1 | |
User vagrant | |
Port 2202 | |
UserKnownHostsFile /dev/null | |
StrictHostKeyChecking no | |
PasswordAuthentication no | |
IdentityFile /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key | |
IdentitiesOnly yes | |
LogLevel FATAL | |
# generate public key out of new private (-y key) | |
$ ssh-keygen -y -f /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key > /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key.pub | |
# copy new identity. will ask for vagran't password, which is `vagrant' | |
$ ssh-copy-id -i /home/ten0s/.vagrant.d/boxes/ten0s-VAGRANTSLASH-centos6.5_x86_64/0/virtualbox/vagrant_private_key -p 2202 [email protected] | |
On cygwin.
$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile C:/Users/Administrator/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
$ ssh-keygen -f C:/Users/Administrator/.vagrant.d/insecure_private_key
$ ssh-copy-id -i C:/Users/Administrator/.vagrant.d/insecure_private_key -p 2222 [email protected]
Hi, I'm totally new to this. Hope this is the solution to the authentication failure I'm getting.
Tried this, but the "ssh-keygen -y -f" is asking for a passphrase, which I do not know.
Can anyone elaborate on this?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are a lifesaver, that works buddy. Do you know why we have to fix it in the first place?
(This is still a mistery to me, sometimes I package a box, add it, and when I 'vagrant up', I'm asked for the password. YOUR fix works and we can then repackage properly which is awesome.)
Thank you buddy