【发布时间】:2020-05-11 02:33:09
【问题描述】:
我正在尝试将我的公共 ssh 密钥添加到我的项目中,但似乎无法使其工作。 根据文档:https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys?hl=fr#project-wide;创建我的 ssh txt 文件后,我需要使用命令:
gcloud compute project-info add-metadata --metadata-from-file ssh-keys=[LIST_PATH]
我将我的 ssh txt 文件命名为“ssh.txt”,而我的完整路径是:C:\Users\33768\Desktop\ssh.txt。
我尝试了以下命令:
gcloud compute project-info add-metadata --metadata-from-file ssh-keys=C:\Users\33768\Desktop\ssh.txt
gcloud compute project-info add-metadata --metadata-from-file ssh-keys="C:\Users\33768\Desktop\ssh.txt"
gcloud compute project-info add-metadata --metadata-from-file ssh-keys=C:/Users/33768/Desktop/ssh.txt
gcloud compute project-info add-metadata --metadata-from-file ssh-keys="C:/Users/33768/Desktop/ssh.txt"
然而,他们都没有工作,错误是:
ERROR: (gcloud.compute.project-info.add-metadata) Unable to read file [LIST_PATH]: [Errno 2] No such file or directory: [LIST_PATH]
我用 [LIST_PATH] 替换了命令行工具显示的实际列表路径。 请有人帮忙,我快疯了。 谢谢。
【问题讨论】:
-
元数据文件需要特定格式。 ssh.txt 的内容是什么?隐藏实际键的掩码。