Created
October 6, 2016 12:07
-
-
Save hodak/4b5256ac0d3f3b11c51ee5309e60367d to your computer and use it in GitHub Desktop.
Add SSH key as authorized key for Vagrant's root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
... | |
id_rsa_pub = File.read("#{Dir.home}/.ssh/id_rsa.pub") | |
config.vm.provision "copy ssh public key", type: "shell", | |
inline: "echo \"#{id_rsa_pub}\" >> /home/vagrant/.ssh/authorized_keys" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment