使用 gsutil 将文件从存储桶移动到实例:"Failure: Cannot serialize credentials for GCE service accounts.."

using gsutil to move file from bucket to instance: "Failure: Cannot serialize credentials for GCE service accounts.."

我正在尝试将文件从存储桶移动到 GCP (Google Cloud Platform) 中的实例。我在云控制台 > Compute Engine > VM 实例中 > 单击列表中实例的“连接”列下的 SSH 按钮。我现在有一个 SSH window 打开并且我 运行:

# gsutil cp gs://cc-test1/test.txt /tmp

其中 gs://cc-test1 是我的存储桶,text.txt 是我要移动到我通过 SSH 进入的实例并将其放在目录 /tmp.[=15 中的文件=]

我收到错误: INFO 1220 14:38:06.447719 transport.py] 正在尝试刷新以获得初始 access_token 失败:无法序列化 GCE 服务帐户的凭据..

实例是Linux。

运行:

# gsutil config

复制输出中的 link 并将其粘贴到浏览器中。

复制出现的授权码。

将授权代码粘贴到 ssh 会话之后: Enter the authorization code:

在 ssh 会话中重新运行 gutil 命令。

PS - 希望有一个不那么费力的解决方案。