Skip to main content

리눅스 머신 실행 (Start a virtual Linux maxhine)

EC2 대시보드로부터 인스턴스 실행접속하기

AWS 관리 콘솔 검색 창에 EC2를 입력합니다.

Screenshot 2023-09-26 at 10.49.54 PM.png

EC2를 선택하여 EC2 대시보드를 엽니다.

인스턴스는 그래픽 사용자 인터페이스(콘솔) 또는 명령줄 스크립트를 통해 시작할 수 있습니다. 먼저 EC2 대시보드라고 하는 그래픽 콘솔 인터페이스부터 시작하겠습니다.

대시보드의 레이아웃에 익숙해지는 데 몇 분 정도 시간을 투자하세요:

  • 왼쪽 탐색 창: 저장된 Amazon 머신 이미지(AMI), 스토리지 볼륨, ssh 키와 같은 도구 및 기능.
  • 가운데: 리소스 목록 및 인스턴스 시작 기능.
  • 오른쪽 창: 문서 및 가격 등의 일반 정보.

Screenshot 2023-09-26 at 10.51.20 PM.png

신규 키페어 생성하기

이 실습 섹션에서는 Linux 인스턴스를 생성하고 로그인하여 몇 가지 Linux 명령을 실행합니다. 인스턴스에 로그인하려면 SSH를 통해 연결할 수 있어야 합니다. 인스턴스에 액세스하기 위한 몇 가지 보안 계층이 있으며, AWS에서 기본적으로 사용하도록 설정되어 있습니다. 그 중 하나는 (아주 대략적으로) 고유한 사용자 이름과 비밀번호와 비슷하다고 생각할 수 있는 SSH 키 쌍을 사용하는 것입니다.

다음 단계에서는 새 Linux 인스턴스에 로그인하는 데 사용할 새 SSH 키 쌍을 만드는 방법을 간략하게 설명합니다.

  1. AWS 관리 콘솔에 로그인하고 Amazon EC2 콘솔(https://console.aws.amazon.com/ec2)을 엽니다.

  2. AWS 관리 콘솔의 오른쪽 상단 모서리에서 원하는 AWS 지역(예: N.Virginia)에 있는지 확인합니다.

실습을 하면서 가끔 사용하는 브라우저의 국가 설정에 의해 다른 리전으로 리전 정보가 바뀌는 경우가 있습니다. 워크샵에 사용하고 있는 리전 정보가 맞는지 꼭 확인해주세요. 다른 리전일 경우 실습이 정상적으로 진행되지 않을 수 있습니다.

Screenshot 2023-09-26 at 10.53.20 PM.png

  1. 왼쪽 탐색창의 Network & Security 섹션에서 Key Pairs 을 클릭합니다. 그러면 SSH 키 쌍을 관리할 수 있는 페이지가 표시됩니다.

Screenshot 2023-09-26 at 10.57.19 PM.png

  1. Key Pairs 페이지에서 브라우저 창 상단의 Create Key Pair 버튼을 클릭합니다.

Screenshot 2023-09-26 at 10.59.25 PM.png

  1. 결과 팝업 창에서 원하는 키 쌍 (Key pair) 이름을 입력하고 EC2 인스턴스에 연결하는 데 사용할 ssh 클라이언트에 따라 .ppk 또는 .pem을 선택합니다(PuTTY의 경우 .ppk 선택). Windows 하위 시스템 Linux, MacOS-X ssh 클라이언트, Linux ssh 클라이언트, Windows ssh 클라이언트의 경우 .pem을 선택합니다.)

이 워크샵의 목적을 위해 여러 명이 동일한 AWS 계정을 사용하는 경우에는 다른 참가자가 제공한 키 쌍 이름과 충돌하지 않도록 고유한 키 쌍 이름을 제공하세요. 쉽게 식별할 수 있도록 키 쌍에 이름 이니셜을 사용할 수 있습니다.

Screenshot 2023-09-26 at 11.01.39 PM.png

  1. Add new tag 를 클릭합니다. 나중에 자세히 설명하겠지만 태그는 AWS에서 리소스를 추적하는 효율적인 방법입니다. 이 리소스에 사용자(User(이니셜 입력)와 가상의 보조금(Grant(숫자를 입력하되 일관성 있게 입력)이라는 두 개의 태그를 추가하겠습니다. Create key pair를 클릭합니다. Click add tag. We’ll get into this later, but tagging is an efficient way to track your resources in AWS. We’ll add two tags to this resource- the user (enter your initials) and an imaginary grant (enter a number, but be consistent). Click on Create key pair.

Screenshot 2023-10-06 at 11.20.08 PM.png

  1. 생성한 키 쌍이 시스템에 자동으로 다운로드됩니다. 브라우저의 안내에 따라 파일을 기본 다운로드 위치에 저장합니다. 파일이 다운로드되었는지 확인하고 파일을 찾을 수 있는지 확인합니다. 방금 다운로드한 .ppk/pem 파일의 전체 경로를 기억하세요. 이 파일에는 향후 SSH 연결을 위한 개인 키가 포함되어 있습니다.The key pair you created should automatically download to your system. Follow any browser instructions to save the file to the default download location. Verify that the file has downloaded and you can locate it. Remember the full path to this .ppk/pem file you just downloaded. This file contains your private key for future SSH connections.

  2. 화면 상단에 Successfully 쌍을created 성공적으로key 만들었습니다pair라는 메시지가 표시됩니다. 생성한 키 쌍이 나열된 것을 볼 수 있습니다. You will see a message appear at the top of the screen that says Successfully created key pair. You will see the key pair you created listed.

Screenshot 2023-10-06 at 11.21.33 PM.png

Launch an EC2 Instance인스턴스 실행하기

We will now launch an이제 EC2 Linux based기반 instance.인스턴스를 시작합니다.

  1. Return to the AWS Management관리 Console콘솔로 and open the돌아가서 Amazon EC2 Dashboard.대시보드를 엽니다.

  2. InAWS the관리 upper-right콘솔의 corner오른쪽 of상단 the모서리에서 원하는 AWS Management Console, confirm you are in the desired AWS region지역(예: (e.g., N. Virginia)Virginia)에 있는지 확인합니다. 

Screenshot 2023-09-26 at 10.53.20 PM.png

  1. ClickLaunch instance를 클릭한 다음 드롭다운 메뉴에서 Launch instance, then다시 click Launch instance again from the drop down menu.클릭합니다.

    Screenshot 2023-09-26 at 11.04.50 PM.png

  1. On the Launch an instance page,페이지에서 you인스턴스에 can대해 choose원하는 a이름을 friendly지정(작성)할 name for your instance.있습니다.

    Screenshot 2023-09-26 at 11.05.25 PM.png

  1. Click on “Add additional tags” and “Add Tag”. You will find the “Name” you provided for your instance. Now enter the key and value. These keys, more correctly known as a tags, will appear in the console once the instance launches. It makes it easy to keep track of running machines in a complex environment. Create additional tags similar for the ones you used for the key pair previously - give a user and grant key to this machine, and enter the same values. When ready, select Instances, Volumes, Network interfaces under the Resource types.

Screenshot 2023-09-26 at 11.06.27 PM.png

Screenshot 2023-09-26 at 11.07.30 PM.pngScreenshot 2023-10-06 at 11.24.57 PM.png

  1. Now이제 select the first번째 Amazon Linux 2023 AMI and check 64-bit (x86) under the선택하고 Architecture drop-down드롭다운 list.목록에서 64-bit(x86)를 선택합니다.

NOTE:설치된 The패키지의 ami-xxxxxxxxx label레이블 and specific특정 versions버전은 of아래 the이미지와 installed다를 package may있습니다.

be different than in the image below.

Screenshot 2023-09-26 at 11.08.49 PM.pngScreenshot 2023-09-26 at 11.08.49 PM.png

  1. Under Instance type,에서 click드롭다운 on화살표를 the클릭하고 drop-down arrow and type검색창에 c5.2xlarge into the search bar.입력합니다.

Note:일반적으로 This작업/분석에 is a somewhat large instance; in general, you should pick these instances based on an analysis of how much필요한 RAM and CPUCPU의 you양을 will분석하여 need이러한 for인스턴스를 your선택해야 job합니다.

/ analysis.

Screenshot 2023-09-26 at 11.09.52 PM.pngScreenshot 2023-09-26 at 11.09.52 PM.png

  1. Under Instance type, click on the drop-down arrow and type c5.2xlarge into the search bar.

Note: This is a somewhat large instance; in general, you should pick these instances based on an analysis of how much RAM and CPU you will need for your job / analysis.

  1. Select the key pair that you created in the beginning of this lab from the drop-down list under Key pair (login).
아래의
드롭다운

목록에서 본인실습의 시작 부분에서 들었던페어를 쌍을 선택합니다!

. 

Screenshot 2023-09-26 at 11.10.13 PM.png

  1. Next click on Edit against다음으로 Network settings 에 대해 Edit을 클릭합니다. You will be prompted to provide Subnet and Security group details.세부 The정보를 security입력하라는 groups메시지가 will표시됩니다. be보안 your그룹은 firewall방화벽 rules.규칙이 됩니다. 
        a. Note서브넷(Subnet) that필드는 the특정 Subnet가용 field영역(AZ)에서 can인스턴스를 be시작하도록 configured구성할 to launch있습니다. the instance워크샵에서는 in기본값을 a유지하지만, specific이렇게 Availability하면 Zone;컴퓨터의 while위치를 we제어할 are keeping있습니다.
     the default for this workshop, this gives you control over the location of your machine.
      b. Provide aSecurity group name for your new security group. NOTEDescription을 입력합니다. 참고: For the실습에서는 purpose"[사용자 of this lab use your “[Your initials]이니셜]-sec-group”group"을 사용합니다.
        c. ConfirmTCP an포트 existing22를 허용하는 기존 SSH rule규칙이 exists있는지 which확인합니다.
     allows TCP port 22.
      d. To어디서든 accept연결을 connections from anywhere, select the drop-down box under the허용하려면 Source type column and아래의 select드롭다운 Anywhere상자를 which will correspond to선택하고 0.0.0.0/0에 해당하는 Anywhere를 선택합니다.

아래와 같은 내용입니다. 각자 내용은 조금씩 상이하지만 이번 실습에서 별도로 수정할 것은 없습니다.

본 예제에서는 launch-wizard-1 이라는 이름으로 보안 그룹 (Security Group)이 만들어지게 됩니다.

Screenshot 2023-09-26 at 11.11.17 PM.pngScreenshot 2023-10-06 at 11.33.18 PM.png

  1. Under Configure storage,에서 you인스턴스에 have스토리지 the ability디스크 to드라이브를 modify수정하거나 or추가할 add storage있습니다. and disk실습에서는 drives스토리지 to기본값을 the그대로 instance. For this lab, we will simply accept the storage defaults.사용하겠습니다.

Screenshot 2023-09-26 at 11.12.12 PM.png

  1. Review your configuration under Summary에서 and구성을 click검토하고 Launch Instance을 클릭합니다.

Screenshot 2023-09-26 at 11.14.06 PM.pngScreenshot 2023-09-26 at 11.14.06 PM.png

Your이제 instance인스턴스가 will시작되며 now잠시 start,시간이 which걸릴 may take a moment. You will be shown the Launch Status page with the message있습니다. Successfully initiated launch of instance 라는 메시지와 함께 Launch Status 페이지가 표시됩니다.

  1. On페이지 the오른쪽 lower right of the page click on하단에서 View all Instances to view the list of클릭하여 EC2 instances.인스턴스 Click목록을 on확인합니다. your인스턴스를 instance.클릭합니다. It초기화 will프로세스를 go거치게 through됩니다. an인스턴스가 initialization process. Once your instance has launched, you will see your시작되면 Linux server서버는 as물론 well인스턴스가 as속한 the가용 영역(Availability ZoneZone)과 the공개적으로 instance라우팅할 is in, and the publicly routable있는 DNS name.이름이 표시됩니다. 

Screenshot 2023-10-06 at 11.39.11 PM.png

워크샵 스튜디오 환경에서 실습시 생성없이 바로 AWS CLI credential을 사용할 수 있음.

Screenshot 2023-09-26 at 10.54.11 PM.png