Alex Ushakov
Alex Ushakov

Reputation: 81

(vagrant & ssh) require password

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.

Upvotes: 3

Views: 1449

Answers (2)

Takamitsu Mizutori
Takamitsu Mizutori

Reputation: 767

Do you have the line like below in your ~/.ssh/config ?

PubkeyAcceptedKeyTypes ssh-dss,ssh-rsa

In my case, after removing this line, vagrant ssh stopped asking me for password.

Upvotes: 0

Artur Aleksanyan
Artur Aleksanyan

Reputation: 500

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"

Upvotes: 1

Related Questions