GCE 專案 加SSH KEY

  1. 在 Compute Engine的Metadata加上 enable-oslogin:
    gcloud compute project-info --project=projectid add-metadata \
        --metadata enable-oslogin=TRUE
    https://cloud.google.com/compute/docs/instances/managing-instance-access
  2. 把SSH KEY塞進去專案中,KEY可以用cloud shell editor 寫到cloud shell平台:
    gcloud compute os-login ssh-keys add \
        --key-file=KEY_FILE_PATH \
        --project=PROJECT \
        --ttl=EXPIRE_TIME
    https://cloud.google.com/compute/docs/connect/add-ssh-keys#os-login

留言

熱門文章