I created a VM instance on the Compute Engine in a Google Cloud project. I want to upload a folder from my computer's local storage onto the boot disk of the virtual machine.
I tried using the scp
command in the command line interface of my computer by typing scp /file/path/name external-ip-address-of-server:.
But then I got the errorPermission denied (publickey). lost connection
I'm also aware that the wget
command can be used to download a file from the internet onto a computer. I thought of using this, but that would require putting my folder online as a download link, which I don't know how to do.
What's the best way to put a folder from local storage onto the boot disk of a virtual machine?
Best Answer
The tool you are looking for is probably
rsync
.A possible command line might be:
Rsync uses
ssh
as its default transport, so before it will work easily for you, it looks like you need to get yourssh
logins working. But that's another question, and one that StackExchange probably already has an answer for.