Skip to content

Instantly share code, notes, and snippets.

@addodelgrossi
Created July 27, 2020 18:37
Show Gist options
  • Save addodelgrossi/842c3f243ec1a1e904749a459492d538 to your computer and use it in GitHub Desktop.
Save addodelgrossi/842c3f243ec1a1e904749a459492d538 to your computer and use it in GitHub Desktop.

Zona

gcloud config set compute/zone us-central1-a

Projeto

gcloud projects list 
gcloud config set project xxx

Compute

gcloud compute instances describe test-ssh

Criar a chave

ssh-keygen -t rsa -b 4096 -C "[email protected]"

Criar uma copia da chave

cp chave.pub chave.pub.gogogle

Editar o arquivo chave.pub.google e colocar no inicio do arquivo usuario:

Adiciono o usuário/chave

gcloud compute instances add-metadata test-ssh --metadata-from-file ssh-keys=/Users/addo/chave.pub.gogogle

Conecto

ssh -i ~/.ssh/id_rsa [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment