(vagrant & ssh) require password

拜拜、爱过 提交于 2019-12-23 21:27:59

问题


my Vagrantfile:

Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.box_check_update = false
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.synced_folder "./synced/", "/home/vagrant/"
config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true

config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024"
    vb.name = "test Ubuntu 14.04 box"
end
end

When I try execute

vagrant ssh

ssh requires password.

But Vagrant should use my local ssh key and do not require password.


回答1:


I've faced the same issue. The problem is you're trying to synch into guest's home folder. I've found the solution here, please refer to that post for more info. You need to change your synch paths.

Instead of

config.vm.synced_folder "./synced/", "/home/vagrant/"

do

config.vm.synced_folder "./synced/", "/home/vagrant/mySyncFolder"


来源:https://stackoverflow.com/questions/29769587/vagrant-ssh-require-password

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