I want to copy a local file from a Vagrant machine to my localhost
, but I am getting an error message:
ssh: connect to host
127.0.0.1>
As @SevenJ mentioned, ssh-config can provide all the info you need. But it's a lot easier to save it to a file and use that file, rather than constructing a complicated scp command. E.g.:
vagrant ssh-config > config.txt
scp -F config.txt default:/path/to/file .
Here I'm assuming your vagrant file doesn't override the machine name from "default". If it does, replace "default:" with ":".