ssh authentication failures

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ssh authentication failures

Randy Black
I built a CentOS6.3 machine based largely on this walk through - https://gist.github.com/367189

I packaged the virtual machine guest, added the box, initialized it and then brought it up.  Then vagrant ssh into the box, no problem.

I did a vagrant halt, then afterwards brought it back up.  It prompted me for a password, then when I did a halt, I received the authentication errors. 

The perms on the private/public look proper, the guest tools are installed. Below, is where I am at now...  I am going to destroy the vm and reimport it see what happenes..?

[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
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.
mbp:Vagrant rblack$ vagrant ssh
vagrant@127.0.0.1's password: 
Last login: Thu Jan 31 22:35:39 2013 from 10.0.2.2

[vagrant@localhost ~]$ lsmod | grep vboxsf
vboxsf                 36639  0 
vboxguest             243880  2 vboxsf

[vagrant@localhost ~]$ ls -al /home/vagrant/
total 32
drwx------. 4 vagrant vagrant 4096 Jan 31 13:02 .
drwxr-xr-x. 3 root    root    4096 Jan 31 12:46 ..
-rw-------. 1 vagrant vagrant  958 Jan 31 22:41 .bash_history
-rw-r--r--. 1 vagrant vagrant   18 May 10  2012 .bash_logout
-rw-r--r--. 1 vagrant vagrant  176 May 10  2012 .bash_profile
-rw-r--r--. 1 vagrant vagrant  124 May 10  2012 .bashrc
drwxrw----. 3 vagrant vagrant 4096 Jan 31 13:02 .pki
drwxr-xr-x. 2 vagrant vagrant 4096 Jan 31 22:36 .ssh

[vagrant@localhost ~]$ ls -al /home/vagrant/.ssh/
total 16
drwxr-xr-x. 2 vagrant vagrant 4096 Jan 31 22:36 .
drwx------. 4 vagrant vagrant 4096 Jan 31 13:02 ..
-rw-r--r--. 1 vagrant vagrant  409 Jan 31 16:47 authorized_keys
-rw-r--r--. 1 vagrant vagrant  391 Jan 31 12:56 known_hosts
[vagrant@localhost ~]$ 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: ssh authentication failures

Brian Lalor
On Feb 1, 2013, at 12:03 AM, Randy Black <[hidden email]> wrote:

The perms on the private/public look proper, the guest tools are installed. Below, is where I am at now...  I am going to destroy the vm and reimport it see what happenes..?

I think your .ssh directory and files therein are too permissive.  Make .ssh mode 700 and the files inside mode 600.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: ssh authentication failures

Randy Black
Thanks blalor.  

Yeah, at first thats what I assumed as well, standard key/pair perms. so this is what I did:
vagrant destroy
boot vbox vm - change perms, poweroff
vagrant package --base CentOS6.3Base
vagrant box add CentOS6.3Base package.box
vagrant up

it failed, then I looked at the perms on the private portion of the key (~/.vagrant.d/insecure_private_key):
    
-rw-------   1 root    staff  1675 Jan 30 23:41 insecure_private_key

change it to my user then - vagrant up, everything went well till I tried to ssh in, but at least it wasn't throwing errors mounting my shares.
vagrant ssh, not so well
vagrant halt, not so well

mbp:Vagrant rblack$ vagrant up
[default] VM already created. Booting if it's not already running...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- v-root: /vagrant
[default] -- workspace: /home/vagrant
mbp:Vagrant rblack$ vagrant ssh
vagrant@127.0.0.1's password: 
Last login: Fri Feb  1 09:52:50 2013 from 10.0.2.2
-bash-4.1$ exit
logout
Connection to 127.0.0.1 closed.
mbp:Vagrant rblack$ vagrant halt
[default] Attempting graceful shutdown of VM...
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.


On Friday, February 1, 2013 5:49:37 AM UTC-6, blalor wrote:
On Feb 1, 2013, at 12:03 AM, Randy Black <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3QXlbVytOEwJ">was...@...> wrote:

The perms on the private/public look proper, the guest tools are installed. Below, is where I am at now...  I am going to destroy the vm and reimport it see what happenes..?

I think your .ssh directory and files therein are too permissive.  Make .ssh mode 700 and the files inside mode 600.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: ssh authentication failures

Randy Black
srsly, I didn't just map the guest home folder to my workspace in my Vangrantfile, idiot.  Oh my goodness, what an infantile and stoopid mistake.

Please delete this post for all who may read it, for only if it saves a few small brain cells, it is worth it......

srsly - I cannot believe the stoopidity of myself right now.  Ugggggg

On Friday, February 1, 2013 10:05:44 AM UTC-6, Randy Black wrote:
Thanks blalor.  

Yeah, at first thats what I assumed as well, standard key/pair perms. so this is what I did:
vagrant destroy
boot vbox vm - change perms, poweroff
vagrant package --base CentOS6.3Base
vagrant box add CentOS6.3Base package.box
vagrant up

it failed, then I looked at the perms on the private portion of the key (~/.vagrant.d/insecure_private_key):
    
-rw-------   1 root    staff  1675 Jan 30 23:41 insecure_private_key

change it to my user then - vagrant up, everything went well till I tried to ssh in, but at least it wasn't throwing errors mounting my shares.
vagrant ssh, not so well
vagrant halt, not so well

mbp:Vagrant rblack$ vagrant up
[default] VM already created. Booting if it's not already running...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- v-root: /vagrant
[default] -- workspace: /home/vagrant
mbp:Vagrant rblack$ vagrant ssh
[hidden email]'s password: 
Last login: Fri Feb  1 09:52:50 2013 from 10.0.2.2
-bash-4.1$ exit
logout
Connection to 127.0.0.1 closed.
mbp:Vagrant rblack$ vagrant halt
[default] Attempting graceful shutdown of VM...
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.


On Friday, February 1, 2013 5:49:37 AM UTC-6, blalor wrote:
On Feb 1, 2013, at 12:03 AM, Randy Black <[hidden email]> wrote:

The perms on the private/public look proper, the guest tools are installed. Below, is where I am at now...  I am going to destroy the vm and reimport it see what happenes..?

I think your .ssh directory and files therein are too permissive.  Make .ssh mode 700 and the files inside mode 600.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.