Copying Files to a Vagrant VM from the Host

I ran into a case where I wanted to have a file that exists on my local also exist on a Vagrant VM. I didn’t need it to be shared; using a shared directory. I also couldn’t move the file to the Vagrantfile path and use the default mounted directory to move it. Instead, I needed a way to use scp to push a file from the host to the guest. Vagrant provides an API that is key to making scp work. With some piping and tools; providing the right credentials for scp is easy.

I also commented on StackOverflow