Skip to content

Instantly share code, notes, and snippets.

@ddossot
Forked from geedew/vagrant-scp
Last active February 2, 2016 22:26
Show Gist options
  • Save ddossot/3594136601095fa21a52 to your computer and use it in GitHub Desktop.
Save ddossot/3594136601095fa21a52 to your computer and use it in GitHub Desktop.
Copying files to a Vagrant VM from host
OPTIONS=`vagrant ssh-config | grep -v '^Host ' | awk -v ORS=' ' 'NF{print "-o " $1 "=" $2}'`

To copy a file from the host to a Vagrant VM:

scp ${OPTIONS} $FILE v:$PATH

to copy a file from a Vagrant VM to the host:

scp ${OPTIONS} v:$PATH $FILE 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment