brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Feb 04. 2021

49. 1주 차 실습 -Azure 2차 인증, 서버생성

계정을 보호하기 위해 2차 인증은 필수이다.

cloud shell로 서버도 만들어 보자.



<1> 계정 보호를 위해 2차 인증을 하자.

<2> cloud shell 사용하기

<3> cloud shell로 서버 만들기

<4> 정리




<1> 계정 보호를 위해 2차 인증을 하자.


1

일반 계정은 MS 사이트에서  2차 인증하라.


2

스마트폰에 마이크로소프트 인증 앱을 설치하라.


3

학생용 계정은 아래 사이트에서  2차 인증하라

학생 계정과 회사 계정은 MS 계정이 생성되지 않는다.

Azure  클라우드 계정 생성 사이트에서  Azure 계정만 생성된다.

이경우  아래 사이트에서 2차 인증을 한다.


2차 인증하는 곳

https://support.microsoft.com/ko-kr/account-billing/microsoft-%EA%B3%84%EC%A0%95%EC%9C%BC%EB%A1%9C-2%EB%8B%A8%EA%B3%84-%EC%9D%B8%EC%A6%9D%EC%9D%84-%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95-c7910146-672f-01e9-50a0-93b4585e7eb4




<2>  cloud shell 사용하기


애저 포털 로그인해서 cloud shell 사용하기

http://portal.azure.com/


1

화면 오른쪽 위에  화살표 모양의 네모난 아이콘을 클릭한다.



2

스토리지 만들기 클릭



3

몇 분 기다리면 Cloud Shell이 실행된다.



4

만들어진 스토리지 확인

디폴트 위치가 동남아시아로 되어 있네요 ㅋ

Cloud Shell은 스토리지를 만들어야,  그곳에 만들어진다.





<3> cloud shell로 서버 만들기


1

현재 구독을 확인?

다른 구독에서 작업하면 그쪽으로 비용이 나오므로

제일 먼저 확인이 필요하다.

필요하다면 구독을 변경해야 한다.

$ az account list


구독 확인

https://portal.azure.com/#blade/Microsoft_Azure_Billing/SubscriptionsBlade



2

현재 리소스 그룹을 확인?

$  az group list

$  az account list --output table


3

서버 만들기?

az vm create -n myVM -g  cloud-shell-storage-southeastasia --image UbuntuLTS --generate-ssh-keys


nm55@Azure:~$ az vm create -n myVM -g  cloud-shell-storage-southeastasia --image UbuntuLTS --generate-ssh-keys

 - Running..

5분 후 서버 생성됨


4

서버 확인?

nm55@Azure:~$ az vm list  --output table

Name    ResourceGroup                      Location       Zones

------  ---------------------------------  -------------  -------

myVM    CLOUD-SHELL-STORAGE-SOUTHEASTASIA  southeastasia


5

IP 확인?

nm55@Azure:~$ az vm  list-ip-addresses  --output table

VirtualMachine    PublicIPAddresses    PrivateIPAddresses

----------------  -------------------  --------------------

myVM              138.91.36.251        10.0.0.4


6

서버 접속?

ssh   계정 이름@서버 IP

nm55@myVM:~$ sudo su -

root@myVM:~# ssh nm55@138.91.36.251


콘솔에서 생성확인


7

IP 확인?

curl ipinfo.io


8

서버 1대 더 만들기?

az vm create --location koreacentral -n myVM-seoul -g  cloud-shell-storage-southeastasia --image UbuntuLTS --generate-ssh-keys

// 위치는 서울에 만들고 , 이름은 myVM-seoul   , 그룹은 cloud-shell-xxxxxxxxx에 만든다.


nm55@Azure:~$ az vm create --location koreacentral -n myVM-seoul -g  cloud-shell-storage-southeastasia --image UbuntuLTS --generate-ssh-keys

 - Running.. (5분 걸린다. 기다려라~)


9

IP 확인?

curl  ipinfo.io


nm55@myVM-seoul:~$ curl  ipinfo.io

{

  "ip": "20.194.4.111",

  "city": "Seoul",

  "region": "Seoul",

  "country": "KR",

  "loc": "37.5660,126.9784",

  "org": "AS8075 Microsoft Corporation",

  "postal": "03186",

  "timezone": "Asia/Seoul",

  "readme": "https://ipinfo.io/missingauth"

}


10

그룹 삭제

az group delete -n cloud-shell-storage-southeastasia


nm55@Azure:~$ az group delete -n cloud-shell-storage-southeastasia

Are you sure you want to perform this operation? (y/n): y

 - Running..


11

참고 사이트

Azure Cloud Shell의 Bash 명령어, 구독 확인, 리소스 그룹 확인, 서버 생성 명령어

https://docs.microsoft.com/ko-kr/azure/cloud-shell/quickstart



<4> 정리


1. 계정을 보호하기 위해 2차 인증을 설정할 수 있게 되었다.

2. 서버에 원격으로 명령을 내리는 cloud shell 설정법과  원격으로 서버를  만드는 법을 알게 되었다.

3. 구독을 확인하는 법을 알게 되었다.



감사합니다.

매거진의 이전글 48. 1주 차 - Azure 계정 만들기
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari