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
As default, the first vagrant instance use ssh port as 2222, and its ip address is 127.0.0.1 (You may need adjust the port with real virtual host)
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
So you can run below command to copy your local file to vagrant instance. password is the same as username which is vagrant
.
scp -P 2222 your_file vagrant@127.0.0.1:.
You can also copy the file back to your local host.
scp -P 2222 vagrant@127.0.0.1:/PATH/filename .