Skip to content
Snippets Groups Projects

Feat copy ssh key to vm

Merged Bo-Chun Chen requested to merge louistw/ohpc_vagrant:feat-copy-ssh-key-to-vm into master
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
+ 4
1
@@ -22,12 +22,15 @@ Vagrant.configure("2") do |config|
@@ -22,12 +22,15 @@ Vagrant.configure("2") do |config|
auto_correct: true
auto_correct: true
end
end
config.vm.provider :virtualbox do |vb|
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.memory = "2048"
vb.memory = "2048"
end
end
 
config.ssh.insert_key = false
 
config.ssh.private_key_path = ["~/.ssh/id_rsa", "~/.vagrant.d/insecure_private_key"]
 
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/authorized_keys"
 
config.vm.provision "shell", inline: <<-SHELL
config.vm.provision "shell", inline: <<-SHELL
if [ -f /vagrant/localenv.sh ]; then
if [ -f /vagrant/localenv.sh ]; then
. /vagrant/localenv.sh
. /vagrant/localenv.sh
Loading