--recurse错误:权限不足:请求的身份验证范围不足

Wes*_*tus 4 terminal google-cloud-platform gcloud

我正在尝试使用以下命令将目录从虚拟机复制到本地计算机的桌面:

gcloud compute scp --recurse instance-1:~/directory ~/Desktop/
Run Code Online (Sandbox Code Playgroud)

我尝试使用“ gcloud auth登录”进行重新身份验证,但仍然显示

ERROR: (gcloud.compute.scp) Could not fetch resource:
 - Insufficient Permission: Request had insufficient authentication scopes.
Run Code Online (Sandbox Code Playgroud)

小智 11

尝试从尝试运行gcloud命令的计算机上运行“ gcloud auth登录”。

有关更多信息,请查看此旧帖子,他们正在报告同一问题。


Joh*_*ley 5

您将需要roles/compute.instanceAdmin.v1使用 SSH 或 SCP 连接到您正在使用的凭据的实例。最简单的方法是添加Compute Instance Admin到您的凭据中。

要查看您正在使用的凭据,请执行gcloud auth list。该帐户将在左栏中有一个星号。

弄清楚你有什么权限执行 gcloud projects get-iam-policy PROJECT_ID