Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied with Vagrant

Tags:

ssh

vagrant

When I do a vagrant ssh in my project on a windows 10 laptop I get this error:

[email protected]: Permission denied (publickey).

When I then delete .vagrant/machines/default/virtualbox/private_key and do vagrant ssh again, I get access to the VM.

But when I then exit the VM and do `vagrant halt', I get this error:

==> default: Attempting graceful shutdown of VM... default: default: Vagrant insecure key detected. Vagrant will automatically replace default: this with a newly generated keypair for better security. default: default: Inserting generated public key within guest... translation missing: en.vagrant_ps.errors.powershell_error.powershell_error

It seems to me that it tries to add my SSH key, but something goed wrong. Any idea how I can solve this?

like image 924
John Avatar asked Jul 20 '18 07:07

John


2 Answers

you can simply run following command in your cmd:

set VAGRANT_PREFER_SYSTEM_BIN=0

vagrant ssh

successfully tested under the windows 10 with vagrant 2.1.5

you can also see: https://www.vagrantup.com/docs/other/environmental-variables.html#vagrant_prefer_system_bin

like image 184
rekinyz Avatar answered Oct 01 '22 00:10

rekinyz


I solved error:

[email protected]: Permission denied (publickey)

editing my Vagrantfile.

It seems Vagrant didn't like this configuration:

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

Edited it to:

config.vm.synced_folder "app", "/vagrant"
like image 37
ViRTUOSiTY Avatar answered Oct 01 '22 00:10

ViRTUOSiTY