Skip to content

Instantly share code, notes, and snippets.

@naufalafif
Created July 29, 2021 14:27
Show Gist options
  • Save naufalafif/22b3fb44548e4ed33065fceea1dc62c5 to your computer and use it in GitHub Desktop.
Save naufalafif/22b3fb44548e4ed33065fceea1dc62c5 to your computer and use it in GitHub Desktop.
Vagrant with ssh installed
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.box_url = "ubuntu/bionic64"
config.vm.network "private_network", ip: "192.168.33.25"
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/me.pub"
config.vm.provision "shell", inline: <<-SHELL
cat /home/vagrant/.ssh/me.pub >> /home/vagrant/.ssh/authorized_keys
SHELL
end
# to access, run `ssh vagrant@192.168.33.25`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment