2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry Pi で gcloud コマンドを使う方法

Last updated at Posted at 2021-10-29

インストールはこちらのページを参考にしました。
Cloud SDK のインストール

#インストール#

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.clou
d.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cl
oud-sdk.list
sudo apt install apt-transport-https ca-certificates gnupg
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyr
ing /usr/share/keyrings/cloud.google.gpg add -
sudo apt update
sudo apt install google-cloud-sdk

#バージョンの確認#

$ gcloud --version
Google Cloud SDK 362.0.0
alpha 2021.10.21
beta 2021.10.21
bq 2.0.71
core 2021.10.21
gsutil 5.4

#auth の設定

gcloud auth login --no-launch-browser

URL が表示されるので、そこで許可をする
そうすると、verification code が表示されるのでそれを、入力する。

#使用例#

次のようなコマンドで、ssh login が出来るようになります。

gcloud beta compute ssh --zone "asia-northeast1-a" "server01"  --project "project01-123456"

ssh コマンドで、ログインするには、次のようになります。

ssh -i $HOME/.ssh/google_compute_engine user@example.com
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?