Vagrant SSH default key passphrase?

若如初见. 提交于 2019-12-23 07:50:56

问题


I think I messed up something simple, normally you should be able to instantly connect to your Vagrant VM using vagrant ssh. However, it's currently different for me.

C:\Users\Sem\Documents\timeline>vagrant ssh
Enter passphrase for key 'C:/Users/Sem/Documents/timeline/.vagrant/machines/default/virtualbox/private_key':
vagrant@127.0.0.1's password:
vagrant@127.0.0.1's password:
vagrant@127.0.0.1's password:
Permission denied (publickey,password).

I found one other person having the same issue: https://github.com/coreos/docs/issues/10#issuecomment-48903893

OS: Windows 8.1 Pro

Vagrant version: 1.7.2

Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
    config.vm.box = "ubuntu/trusty64"
end

I did try multiple settings before, but if I use this Vagrantfile with vagrant destroy and vagrant up the problem remains.

If there is any information missing, please tell me.


回答1:


Very new to vagrant and linux in general so this is for those who are like me. By default there is no passphrase so simply hitting enter will work. It will then ask you for the password which by default is 'vagrant'.




回答2:


Even though I was searching for something else I found the solution to this problem.

I Added this to my Vagrantfile:

config.vm.provider "virtualbox" do |v|
    v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
    v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end

It also made the internet connection in my vagrant VM super fast! :)




回答3:


Check permissions on your key file. I had the same problem and it was caused by OpenSSH rejecting my key file due to too open permissions. Also you can troubleshoot any Vagrant command with --debug key.



来源:https://stackoverflow.com/questions/29452656/vagrant-ssh-default-key-passphrase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!