user1700890
user1700890

Reputation: 7742

gcloud compute scp - permission denied error

I would like to transfer file from my local machine to Google cloud instance. Here is my command:

gcloud compute scp "C:\Temp\esim_replication.ipynb" nlp-3:

Here is error message:

pscp: unable to open ./esim_replication.ipynb: permission denied
ERROR: (gcloud.compute.scp) [C:\Program Files (x86)\Google\Cloud SDK\google-clou
d-sdk\bin\sdk\pscp.exe] exited with return code [1].

This is brand new error. Everything worked fine 2 weeks ago. I am on Windows 7 locally and ran cmd as Administrator. I tried the above command with and without quotations.

Any suggestions?

Upvotes: 3

Views: 5716

Answers (5)

Helson
Helson

Reputation: 21

Encountered the same error while transferring from my local Windows desktop to Debian VM in GCP.

Changed the permission of the destination folder to 777.

gcloud compute scp source_folder/File1.txt VM_instance_name:destination_folder

It worked!

Upvotes: 2

balukov
balukov

Reputation: 51

Go to gcloud via ssh:

gcloud beta compute ssh --zone "your_zone" "instance_name" --project "project_name"

Give full access to your file:

sudo chmod 777 esim_replication.ipynb

Upvotes: 4

Sean Kenny
Sean Kenny

Reputation: 123

What? from a windows machine?

'sudo' is not recognized as an internal or external command, operable program or batch file.

Upvotes: 1

nbckr
nbckr

Reputation: 21

In case someone finds this like I did: I had a similar error message, and what did the trick for me was using sudo: sudo gcloud compute scp [LOCAL] [REMOTE]. Apparently there was the need for updating the project ssh metadata (even though copying in the other direction worked just fine).

Upvotes: 2

user1700890
user1700890

Reputation: 7742

It turned out that I already had identically named file at destination. This caused the error. But Patrick W comment is very helpful

Upvotes: 0

Related Questions