[OCI] OCI 인스턴스 생성 / Create OCI Instance

👉 오라클 클라우드에서 VM인스턴스 생성하는 방법에 대한 내용입니다.
This article explains how to create a VM instance in Oracle Cloud.

👉 먼저 내용을 모르면 과금될 수 있기때문에 아래의항목에서 무료 범위를 확인 하시길 바랍니다.
First, please check the free range in the items below, as you may be charged if you do not know the content.

👉 먼저 아래는 OCI프리티어 범위 입니다.
First, below is the OCI Free Tier range.

✔️ 한글 / Korean
https://www.oracle.com/kr/cloud/free/#always-free

✔️ 영문 / English

https://docs.oracle.com/en-us/iaas/Content/FreeTier/freetier_topic-Always_Free_Resources.htm

👉OCI.com에 로그인 후 메뉴에서 Instances를 선택합니다.
After logging in to OCI.com, select Instances from the menu.

👉Create Instance버튼을 눌러서 Instance생성을 시작합니다.
Click the Create Instance button to start creating an instance.

✔️ 과정은 아래의 영상을 참조하시면 됩니다.
You can refer to the video below for the process.

👉OCI접속방법 / How to access OCI

✔️ OCI접속시는 SSH를 사용합니다.
SSH is used when connecting to OCI.

✔️ 윈도우 파워쉘 또는 맥os의 터미널을 열고 아래와 같은 형식으로 접속하시면됩니다.
You can open Windows PowerShell or macOS Terminal and connect using the following format.

ssh -i "C:\Users\User\... key file path...\ssh-key-date.key" ubuntu@ipaddress

👉접속 오류 : 윈도우에서 다음과 같은 오류로 접속되지 않을 때
Connection error: When you cannot connect with the following error in Windows:

✔️ 아래와 같은 오류는 윈도우에서 키파일에 대한 접속 권한 설정 문제입니다.
The error below is a problem with the access permissions for the key file in Windows.

PS C:\Users\User> ssh -i "C:\Users\User\...\App\ssh-key-2000-10-23.key" ubuntu@140.100.100.11
Bad permissions. Try removing permissions for user: \\Everyone (S-1-1-0) on file C:\Users\User\...\App\ssh-key-2000-10-23.key.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'C:\Users\User\...\App\ssh-key-2000-10-23.key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "C:\Users\User\...\App\ssh-key-2000-10-23.key": bad permissions
ubuntu@140.100.100.11: Permission denied (publickey).

✔️ 윈도우즈 파워 쉘을 열고 다음을 붙여넣고 실행합니다.(파일경로는 여러분의 파일경로로 수정해야 함)
Open Windows PowerShell, paste the following, and run it (you’ll need to change the file path to your own):

# 1. 경로 변수 설정(여러분의 파일 경로)
# Set the path variable (your file path)
$path = "C:\Users\User\...\App\ssh-key-2000-10-23.key"

# 2. 모든 상속을 제거하고 현재 권한을 초기화
# Remove all inheritance and reset current permissions
icacls $path /inheritance:r /c /t

# 3. 현재 로그인한 사용자($env:USERNAME)에게만 읽기(R) 권한 부여
#  Grant read (R) permission only to the currently logged in user ($env:USERNAME)
$username = $env:USERNAME
icacls $path /grant:r "${username}:(R)"

# 4. (중요) 'Everyone'이나 'Users' 그룹이 남아있다면 강제 제거
# (Important) If the 'Everyone' or 'Users' group remains, forcefully remove it.
icacls $path /remove "Everyone"
icacls $path /remove "Users"
icacls $path /remove "Authenticated Users"

Leave a Reply