How to copy file from a Vagrant machine to localhost

后端 未结 7 529
隐瞒了意图╮
隐瞒了意图╮ 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:04

    You should read the manual page for scp. The correct syntax is:

    scp -P 2222 vagrant@127.0.0.1:/home/vagrant/devstack/local.conf .
    

    The uppercase P is for "port". Lowercase is used to preserve modification times.

提交回复
热议问题