728x90
반응형
GCP VM Instance 화면에서 ssh 버튼을 통하지 않고 Cloud Shell 에서 직접 SSH 를 접근 할 경우 쓰는 방법이다.
gcloud compute ssh --project [PROJECT_ID] --zone [ZONE] [INSTANCE_NAME]
cloud Shell 에 접근한후 다음과 같이 하면 된다.
먼저 instance list 를 조회한다.
gcloud compute instances list
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
myinstance us-central1-a n1-standard-1 10.128.0.2 146.148.43.62 RUNNING
그리고 위에 명령어처럼 아래와 같이 접근을 하면 된다.
gcloud compute ssh --zone us-central1-a myinstance
간단하네~
참고 사이트
https://cloud.google.com/compute/docs/instances/connecting-to-instance
728x90
반응형