Author Topic: ssh ผ่าน mac os เข้าไปยัง google cloud platform  (Read 4096 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ssh ผ่าน mac os เข้าไปยัง google cloud platform
« on: เมษายน 06, 2017, 09:41:07 PM »
ssh ผ่าน mac os เข้าไปยัง google cloud platform

1.ทำการลง python ให้เรียบร้อยก่อนครับ
$python -v

2.หลังจากลง python แล้วทำการ download package install google cloud ssh
$wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-150.0.0-darwin-x86_64.tar.gz

3.Extract the archive to any location on your file system.
$tar zxf google-cloud-sdk-150.0.0-darwin-x86_64.tar.gz

4.install รัน install.sh
/google-cloud-sdk/install.sh

5. ทำการสร้าง auth login ผูกกับ key ของเครื่อง client(mac) ที่จะเข้าไปยัง gcloud instance ขั้นตอนนี้จะ redirect ไปยังหน้าเว็บเพื่อให้ยืนยันการใช้งานตัว SDK tool ครับ ก็ทำการยืนยันผ่าน gmail account ไป
./gcloud auth login

6. หลังจากสร้างเรียบร้อยก็ทำการ รัน connect ผ่าน ssh ดูครับ
./gcloud compute --project "packetlove-projectZ" ssh --zone "asia-west1" "app1name"

ก็จะเข้าไปยัง shell ได้ครับผม : )
##reference
https://cloud.google.com/sdk/docs/quickstart-mac-os-x
https://cloud.google.com/sdk/gcloud/reference/compute/ssh