How to copy file from a Vagrant machine to localhost
Another option is cat
the files to something local:
vagrant ssh -c "sudo cat /home/vagrant/devstack/local.conf" > local.conf
This should also work for files that require root permissions (something the vagrant SCP plugin doesn't seem to support).
You should read the manual page for scp
. The correct syntax is:
scp -P 2222 [email protected]:/home/vagrant/devstack/local.conf .
The uppercase P is for "port". Lowercase is used to preserve modification times.