How to copy file from a Vagrant machine to localhost

后端 未结 7 686
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 13:53

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

7条回答
  •  情书的邮戳
    2021-01-30 14:01

    Get IdentityFile and Port by using

    vagrant ssh-config
    

    scp -i IdentityFile_file -P Port vagrant@127.0.0.1:/file_dir dist_dir e.g.

    scp -i /Users/xxxxx/tmp/vagrant/centos_6.5/.vagrant/machines/default/virtualbox/private_key -P 2200  vagrant@127.0.0.1:/tmp/xxx .
    

提交回复
热议问题