I can move files from my laptop to a gcloud VM instance just fine, the other way around however is not so easy. According to this website I am to use this syntax:

scp -i ~/.ssh/my-ssh-key username@ip-address:remote-file-path local-file-path

I have done all that. At first I got the warning:

The authenticity of host can't be established.
ECDSA key fingerprint is zzzzz
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added (ECDSA) to the list of known hosts.

Then I got the error message:

kylefoley@ Permission denied (publickey).

I am putting these commands in the terminal of my local laptop. I then went and changed all of the permissions for each folder, subfolder and file. But that did not help.


I don't why the above syntax did not work but the following syntax does work in command line

gcloud compute scp --zone us-west2-a [instance-name]:[path-to-file] [local-path]

That incidentally was the syntax I was using to move files from the laptop to the vm instance but I did not think it would work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.