-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vagrant can't connect to Digital Ocean via ssh #144
Comments
I've now spent about 16 hours just trying to set this up... crazy. |
Have you found any solutions for this issue? |
@Olofguard Nope :( Wasted hours trying to get it working. Still no go! What OS are you using? |
I'm on OS X 10.9.4. |
@Olofguard Ahh I'm ElementaryOS (Ubuntu based) |
Try to remove your ssh key on Digital Ocean panel. Vagrant try to register the ssh key always when you create a doplet. |
Using ssh key already on account or allowing Vagrant to create key yields same result:
Vagrantfile follows: Vagrant.configure('2') do |config|
config.vm.hostname = 'hostname'
config.vm.provider :digital_ocean do |provider, override|
override.ssh.private_key_path = '~/.ssh/id_rsa'
override.vm.box = 'digital_ocean'
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
provider.token = '<token>'
provider.image = 'CoreOS (stable) 444.5.0'
provider.region = 'nyc3'
provider.size = '512mb'
provider.ipv6 = true
end
end |
I take it no one has found a solution to this issue? |
I think I'm hitting this issue right now... And it looks like the same as #134. I'm trying to use the CoreOS image, and the problem is that I can't override the ssh username.. It's always root, and didn't find a way to override it yet.. I'll try again and send my conclusions. Cheers |
I managed somehow :) I think the real issue here is because we are not able to override config.ssh.username. Should I open a new issue, or can it stays here? |
I wasn't able to get this working even after trying @pierreozoux's solution. I hope this gets fixed soon. I would help, but I'm not a Rubyer :) |
I'm also running into this problem. My
|
I've run into this issue myself and managed to fix it by going on the https://cloud.digitalocean.com/settings/security page and setting the ssh key value for the 'vagrant' username to be my public ssh key. Check out the help articles for more info on adding ssh keys: https://cloud.digitalocean.com/settings/security/help/articles |
@godlovesugly Thank you! Worked like a charm. |
I spent hours trying to solve this. Later I tried the same steps from another machine B and it failed. My guess is that multiple SSH keys with the same filename is causing conflict even though the old ssh key is removed from the DigitalOcean console. |
In my case, @pierreozoux led me to a workaround for this.
|
@michelekappa Thank you, it works. Or config |
Following @pierreozoux solution, the following steps worked for me
|
+1 I've had it working at some point where I could start vagrant fully every time, but couldn't halt it as noted in another issue I started. Now I can't get it to start fully due to SSH connection issues. It seems to be some kind of problem with timing as the debug log looks like it's getting connected and the key works, but then vagrant keeps trying and starts failing. None of the solutions mentioned so far have resolved this for me. I'd like to help fix this and other SSH related issues on this project if I can be of any help. If I kill the vagrant up process and try Here's the logwith lots of the noise removed On the first few tries, SSH isn't up. So it correctly fails.
Then it is able to connect to SSH and tries the public key and apparently succeeds.
But then for some reason it tries again and fails. And keeps failing in this way until I kill the process.
My vagrant file
|
More info. I've tried to dig into this project code and find the cause of this, but ruby isn't a strong skill for me, and I haven't gotten to know the vagrant code base either. So I didn't find the cause, but I did find that changing my vagrant config makes it work or not. This works:
But change the So I suspect there is something wrong with my image as relates to the ssh key. Any ideas why the base image works, but my image derived from a base doesn't? |
Working on this a bit more and I found the source of the issue (for me, in this one case anyway) was that something was happening while using packer to provision a new image from a previously created one. Without going into details on the packer issue, here in a vagrant repo, the cause of not being able to login with the SSH key wasn't that the key was wrong or missing. It was that something is changing the owner of the /root directory to www-data. Everything below /root is still owned by the root user. But that base directory being owned by the apache user causes SSH to refuse to work because the ssh keys can be gotten to by the apache user, not just the root user. This is a good safety feature. I'm still not sure what's causing the ownership change though. Fixing the issue manually requires getting a root password generated for the droplet, logging in as root, and issuing I'm hoping this helps someone else if you haven't found the solution yet with the other reasons for failure. If I can isolate the cause of the change, I'll add that here. Never the less, it seems in this case unrelated to vagrant or this plugin. |
I could be wrong but I believe this is the same issue as #244 seeing as how it was almost the exact same output I was receiving. I'm waiting for a response from the other commenters, but I believe I posted a solution. It has to do with DO's default accepted sshkeys. You can view my comment/solution here. |
user should not be "root" it is "core"... |
My Digital Ocean account has a valid ssh key set-up etc. When I run
vagrant up --provider=digital_ocean
it hangs for ages. When I run it withVAGRANT_LOG=debug vagrant up --provider=digital_ocean
I get loads of warnings and errors claiming the ssh details are failing.I noticed in those errors:
Or something similar. But the ssh key I'm referencing has a password and the username is ewan. So does anyone know why it would be using 'root' as the user and without a password? I'm not running as sudo or anything either.
I've used the plug-in loads of times well before, but I've just got it set-up on a new laptop with no such luck.
Cheers,
Ewan
The text was updated successfully, but these errors were encountered: