I have a use case where I occasionally want to copy a single file from my host machine to the Vagrant guest.
I don\'t want to do so via traditional provisioners (Pup
Here is my approach to the problem:
Step 1 - Find the private key, ssh port and IP:
root@vivi:/opt/boxes/jessie# vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /root/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
Step 2 - Transfer file using the port and private key as parameters for scp:
scp -P 2222 -i /root/.vagrant.d/insecure_private_key \
someFileName.txt vagrant@127.0.0.1:~
I hope it helps,