Oracle cloud shell

oracle cloud 서버에 접속하기 위해 cloud shell에 접속환경을 만들었다.

ssh key 생성

아래와 같이 private key, public key 생성

yongsub_yu@cloudshell:~ (ap-seoul-1)$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/yongsub_yu/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/yongsub_yu/.ssh/id_rsa.
Your public key has been saved in /home/yongsub_yu/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
+---[RSA 2048]----+
|      .o   .+    |
|     .. = +=o.  o|
|      .B BEoo+ +.|
|    ..+o=.=.. =  |
|     o.oSo o + . |
|     ...o . . +  |
|      ..   o .   |
|        . o +... |
|         . =ooo.+|
+----[SHA256]-----+

접속대상 서버의 .ssh/autorized_key 파일에 위에서 생성된 public_key 등록

접속할 서버 .ssh/config 에 등록

yongsub_yu@cloudshell:~ (ap-seoul-1)$ cat .ssh/config
Host
HostName
User
IdentityFile ~/.ssh/id_rsa
Host
HostName
User
IdentityFile ~/.ssh/id_rsa
Host
HostName
User
IdentityFile ~/.ssh/id_rsa
Host sbg
HostName
User
IdentityFile ~/.ssh/id_rsa

cloud shell의 Public IP 조회

cloud shell에서 아래와 같이 Public IP를 조회하고

yongsub_yu@cloudshell:~ (ap-seoul-1)$ curl ipecho.net/plain
132.145.85.85

firewall 정책 추가

답글 남기기