Search code examples
vagrantssh-keys

Vagrant SSH Permissions


I am new to Vagrant and get the following error on vagrant up or vagrant ssh:

The private key to connect to this box via SSH has invalid permissions
set on it. The permissions of the private key should be set to 0600, otherwise SSH will
ignore the key. Vagrant tried to do this automatically for you but failed. Please set the
permissions on the following file to 0600 and then try running this command again:

[...]/.vagrant/machines/default/virtualbox/private_key

I have run:

$ sudo chmod 666 [...]/.vagrant/machines/default/virtualbox/private_key

I also tried (600, 777) but still get the same error.

Please can someone tell me what is wrong and how to fix it?


Solution

  • Got this error using otto (which layers on vagrant) It is def filesystem related, have a fat partition to allow use with windows (used to, no longer). When the permissions couldn't be set on the partition I just copied the whole directory over to my user directory (as I always should have).

    Was using git so I just reset to head to get back to my starting place... re-ran: otto compile otto dev up and running now.