Vagrant: How to provide custom SSH key location to solve chmod 600 error ?

Hello Everyone,
So today I am trying to spin a new vagrant instance from my Arch installation in a NTFS Partition.
So during `vagrant up` command, I got an error stating that it cant execute `chmod 600` command in my NTFS parition as my Vagrantfile located at my NTFS mount.
So on searching a bit, I came across custom SSH location config can be added to Vagrantfile as below

config.ssh.insert_key = false
config.ssh.private_key_path = "~/.vagrant.d/insecure_private_key"


so my Vagrantfile config over looks like below

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.network "private_network", ip: "192.168.33.10"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.ssh.insert_key = false
  config.ssh.private_key_path = "~/.vagrant.d/insecure_private_key"
end


And I have deleted the old vagrant machine with `vagrant destroy` command, and re provisioned the current vagrant machine with `vagrant up` and issue then I was able to SSH into the vagrant machine successfully with `vagrant ssh`.
Hope it helps.
Thank you.

Comments

Popular posts from this blog

grep: unknown device method

Uploading files to FTP/SFTP using CURL

How to find outgoing IP in Linux ?