brunch
매거진 NCP Security

(정식) 보안1. VPC 생성, 서버 생성

by Master Seo

# 실습 환경 생성

# 네트워크 VPC를 생성하자.

# 우분투 서버 생성하자.



<1> 실습 환경

<2> VPC1 172.16, 우분트 24.04 1대 생성

<3> VPC2 10.0 , 로키 리눅스 2대 생성



<1> 실습 환경


슬라이드1.JPG




1

vpc2 생성 10.0.0.0/20

publlic subnet 생성 10.0.2.0/24

로키리눅스 1대 생성 1대


2

로키 로그인

계정 test

암호 1234


# 로키

useradd test

passwd test


1234


3

패스워드 사전



4자리 영문자 조합 만들기

crunch 4 4 1234 -o dic.txt





4

ssh 접속 공격



hydra -t 4 -l test -P dic.txt 공인ip ssh



5

결과

패스워드 1234로 나온 화면 캡춰




<2> VPC1 172.16, 우분트 24.04 1대 생성


1

hacker-vpc

172.16.0.0/20


pub1

172.16.2.0/24



2

Hacke01 서버 생성


KVM

우분트 24.04

High-CPU

시간 요금제

sec-srv1

새로운 공인 IP 할당

스토리지 50GB

ncp-2024-1019-1

생성



3

로키 리눅스 생성


web

init



#!/bin/bash

yum -y install httpd

systemctl enable httpd

systemctl start httpd

echo '<html><h1>Hello From Your Web Server!</h1></html>' > /var/www/html/index.html



init-script


#!/bin/bash

Wget -O /etc/yum.repos.d/Rocky-Extras.repo http://init.ncloud.com/server/linux/repo/rocky8/Rocky-Extras.repo

yum clean all

yum -y install httpd php mariadb-server php-mysqlnd

sleep 60

cd /var/www/html


wget https://kr.object.ncloudstorage.com/ncp-manual/handson/lab.tgz

tar xvfz lab.tgz


/usr/bin/cp -rf php.conf /etc/httpd/conf.d/php.conf

/usr/bin/cp -rf www.conf /etc/php-fpm.d/www.conf


systemctl enable mariadb

systemctl enable httpd

systemctl enable php-fpm

systemctl start mariadb

systemctl start httpd

systemctl start php-fpm





<3> VPC2 10.0 , 로키 리눅스 2대 생성



슬라이드1.JPG

1

vpc2

10.0.0.0/20

슬라이드2.JPG


2

서버 2,3 생성 - 로키 리눅스

agame-dev-web01

agame-dev-web02




3

ACG - 내 IP 모두 허용

10.x대 모두 허용


내 IP 모두 허용

20 my-ip.png



10.x대 모두 허용 - 내부에서 모두 통신- 10.0.0.0/16 1-65535허용


10. 10.png





4

root로 로그인


test 계정 생성


# 로키 리눅스 계정 추가법

useradd test

passwd test


1234





# 기타 참고 - 우분트 경우 계정 추가법

adduser test



다음

https://brunch.co.kr/@topasvga/4712


keyword
매거진의 이전글14. 네이버 관리 - Ncloud SSO