Skip to content

Instantly share code, notes, and snippets.

@mstuttgart
Created May 29, 2024 20:31
Show Gist options
  • Save mstuttgart/2b6ed39e6838ded086e68274b56ded24 to your computer and use it in GitHub Desktop.
Save mstuttgart/2b6ed39e6838ded086e68274b56ded24 to your computer and use it in GitHub Desktop.
Copy public key to .ssh/authorized_keys inside Vagrant vm

Copy public key to .ssh/authorized_keys inside Vagrant vm:

Vagrant.configure("2") do |config|
  config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/authorized_keys"
  config.ssh.private_key_path = ["~/.vagrant.d/insecure_private_key", "~/.ssh/id_rsa"]
  config.ssh.insert_key = false
end
``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment