Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Grafana
- docker
- InfoProvider
- 클라우드
- react
- DW
- InfoCube
- JavaScript
- InfoObject
- 특약매입
- Spring
- EC2
- BW4HANA
- HANADB
- SAP
- VSCode
- 직매입
- Git
- Jenkins
- Python
- BW
- 자료형
- ADSO
- GitHub
- Java
- 배포
- 깃허브
- 파이썬
- aws
Archives
- Today
- Total
개몽가
[GCP] 로컬에서 GCP VM 인스턴스 SSH 접속 본문
- SSH 키 생성 여부 확인
$ cat ~/.ssh/id_rsa.pub cat: /Users/shingme/.ssh/id_rsa.pub: No such file or directory
- SSH 키 생성
$ cd /Users/shingme $ ssh-keygen -t rsa -C "shinmi@gmail.com" Generating public/private rsa key pair. Enter file in which to save the key (/Users/shingme/.ssh/id_rsa): /Users/shingme/.ssh/id_rsa_gcloudbysm Created directory '/Users/shingme/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: (생략....)
- SSH 키 확인
private key : id_rsa_gcloudbysm$ cd ~/.ssh $ ls id_rsa_gcloudbysm id_rsa_gcloudbysm.pub
public key : id_rsa_gcloudbysm.pub - public key를 GCP 메타데이터 등록 (간략하게 기입)
GCP console > Compute Engine > 설정 > 메타데이터 > SSH
수정 클릭
항목 추가
public key 값 복붙하면 됨 - GCP VM인스턴스 접속
$ ssh -i ~/.ssh/id_rsa_gcloudbysm shinmi@xx.xx.xx.xx The authenticity of host 'xx.xx.xx.xx' can't be established. ECDSA key fingerprint is SHA256:... Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'xx.xx.xx.xx' (ECDSA) to the list of known hosts. Enter passphrase for key '/Users/shingme/.ssh/id_rsa_gcloudbysm': Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-1038-gcp x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage * Super-optimized for small spaces - read how we shrank the memory footprint of MicroK8s to make it the smallest full K8s around. https://ubuntu.com/blog/microk8s-memory-optimisation (생략...)
- 터미널 ssh config 등록
~/.ssh 에 config 파일 생성 후 아래와 같이 설정
Host gcp-dev # 호스트명 HostName xx.xx.xx.xx # 퍼블릭 IP주소 User shinmi # 사용자 이름 IdentityFile ~/.ssh/id_rsa_gcloudbysm # 프라이빗키 파일 경로
- GCP VM 인스턴스 접속
$ ssh gcp-dev
'Infra > DevOps' 카테고리의 다른 글
venv 가상환경으로 Flask 웹 서버 구축하기 (0) | 2022.06.13 |
---|---|
[AWS] AZ, Region, VPC, Subnet 개념 (0) | 2022.01.25 |
[시각화/대시보드] 그라파나 google OAuth2.0 연동 (0) | 2021.08.08 |
[시각화/대시보드] Grafana Docker 기반 설치 (0) | 2021.06.27 |
[Docker] AWS EC2 RHEL 버전8 Docker 설치 (0) | 2021.01.24 |