Easiest way to copy a single file from host to Vagrant guest?

前端 未结 19 1773
暖寄归人
暖寄归人 2020-12-22 15:15

I have a use case where I occasionally want to copy a single file from my host machine to the Vagrant guest.

I don\'t want to do so via traditional provisioners (Pup

19条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-22 15:40

    You can add entry in ~/.ssh/config:

    Host vagrant
        User vagrant
        HostName localhost
        Port 2222
        IdentityFile /home/user_name/.vagrant.d/insecure_private_key
    

    and the simplescp file vagrant:/path/. You can find path to identity file using the vagrant ssh-config command.

提交回复
热议问题