Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

--recurse ERROR: Insufficient Permission: Request had insufficient authentication scopes

I'm trying to copy a directory from my vm to my local machine's Desktop with the following command:

gcloud compute scp --recurse instance-1:~/directory ~/Desktop/

I tried reauthenticating with "gcloud auth login" however it still says

ERROR: (gcloud.compute.scp) Could not fetch resource:
 - Insufficient Permission: Request had insufficient authentication scopes.
like image 688
Wes Avatar asked Feb 12 '19 17:02

Wes


2 Answers

Try to run a "gcloud auth login" from the machine that you are trying to run the gcloud command.

For more information have a look at this old post, they are reporting the same issue.

like image 61
Eduardo Ruela Avatar answered Oct 14 '22 02:10

Eduardo Ruela


You will need roles/compute.instanceAdmin.v1 to use SSH or SCP to an instance for the credentials that you are using. The simplest method is to add Compute Instance Admin to your credentials.

To see what credentials you are using execute gcloud auth list. The account will have an asterisk in the left column.

To figure out what permissions you have execute gcloud projects get-iam-policy PROJECT_ID

like image 30
John Hanley Avatar answered Oct 14 '22 01:10

John Hanley