(vagrant & ssh) 需要密码 [英] (vagrant & ssh) require password

查看:62
本文介绍了(vagrant & ssh) 需要密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的流浪档案:

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

当我尝试执行时

vagrant ssh

ssh 需要密码.

但是 Vagrant 应该使用我本地的 ssh 密钥并且不需要密码.

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

推荐答案

我遇到了同样的问题.问题是您正在尝试同步到来宾的主文件夹.我找到了解决方案 此处,有关详细信息,请参阅该帖子.您需要更改同步路径.

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.

代替

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

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

这篇关于(vagrant & ssh) 需要密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆