Linux 운영 체제 – 완전한 DevOps 학습 노트

발행: (2026년 1월 7일 오전 03:50 GMT+9)
8 min read
원문: Dev.to

I’m happy to translate the article for you, but I’ll need the full text of the post (excluding the source line you already provided). Could you please paste the content you’d like translated? Once I have it, I’ll keep the source link at the top unchanged and translate the rest into Korean while preserving the original formatting, markdown, and technical terms.

Part 1 – Linux Fundamentals & Architecture

1. What is Linux?

Linux는 오픈‑소스이며 Unix‑계열 운영체제 커널입니다. DevOps 환경에서 “Linux”는 일반적으로 배포판(예: Ubuntu, CentOS, Alpine)을 의미하며, 커널, 시스템 유틸리티 및 패키지 관리자를 포함합니다.

ComponentDescription
KernelCPU, 메모리 및 I/O를 관리하는 핵심
Shell커널에 대한 CLI 인터페이스(예: Bash, Zsh)
Userspace애플리케이션이 실행되는 영역

2. Linux File‑System Hierarchy

Linux는 루트 **/**에서 시작하는 단일 계층 트리를 사용합니다.

/
├─ bin & /usr/bin      – Essential user binaries (ls, cp, …)
├─ etc                – Configuration files (e.g., /etc/nginx/nginx.conf)
├─ home               – User home directories (e.g., /home/john)
├─ var                – Variable data (logs, spool files, temporary e‑mail)
├─ tmp                – Temporary files (cleared on reboot)
└─ proc               – Virtual FS exposing process & kernel info

Part 2 – 필수 파일 관리 및 권한

1. 파일‑관리 명령

카테고리명령
네비게이션pwd – 현재 작업 디렉터리 출력
cd – 디렉터리 변경
ls -la – 모든 파일을 상세히 목록 표시
조작touch file – 빈 파일 생성
mkdir -p dir/subdir – 디렉터리 생성(필요 시 상위 디렉터리도 함께)
cp -r source dest – 재귀적으로 복사
mv source dest – 이동/이름 변경
rm -rf path – 강제 삭제(사용 시 주의)
보기cat file
less file
head file
tail file

2. 파일 권한

권한은 사용자 (u), 그룹 (g), 기타 (o) 로 구분됩니다.

기호
r (읽기)4
w (쓰기)2
x (실행)1

일반적인 명령

chmod 755 file          # u=rwx (7), g=rx (5), o=rx (5)
chmod +x script.sh      # 실행 비트 추가
chown user:group file   # 소유자와 그룹 변경
chgrp group file        # 그룹만 변경

Part 3 – 사용자, 그룹 및 패키지 관리

1. 사용자 및 그룹 관리

파일목적
/etc/passwd사용자 계정 정보
/etc/shadow보안 비밀번호 해시
/etc/group그룹 정의

일반적인 명령

# Create a user with a home directory and Bash shell
useradd -m -s /bin/bash username

# Add user to the sudo group
usermod -aG sudo username

# Set (or change) password
passwd username

# Show UID/GID information
id username

2. 패키지 관리

배포판 계열패키지 관리자설치 명령업데이트 / 업그레이드 명령
Debian / Ubuntuaptapt install <package>apt update && apt upgrade
RHEL / CentOSyum / dnfyum install <package>yum update
Alpineapkapk add <package>apk update

Part 4 – 네트워킹 및 방화벽

1. 네트워크 구성 및 문제 해결

명령설명
ip addr showIP 주소 표시 (ifconfig의 최신 대체 명령)
ip route라우팅 테이블 표시
ping <host>연결 상태 테스트
curl -I <url>HTTP 헤더 표시
wget <url>파일 다운로드
nslookup <domain> / dig <domain>DNS 조회
netstat -tulpn or ss -tulpn수신 포트 목록 표시 (서비스 디버깅에 유용)

2. 리눅스 방화벽

방화벽일반적인 사용
UFW (Ubuntu)iptables 위에 얹은 간단한 래퍼
firewalld (CentOS/RHEL)동적 방화벽 관리자
iptables레거시, 저수준 패킷 필터

예시

# UFW
ufw allow 22/tcp          # allow SSH
ufw enable                # enable firewall

# firewalld
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

# iptables (basic example)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

Part 5 – 프로세스, Systemd, 및 부팅

1. 부팅 과정

  1. BIOS/UEFI – 하드웨어 POST 수행 후 부트로더를 로드합니다.
  2. Bootloader (GRUB) – 커널 이미지를 로드합니다.
  3. Kernel – 루트 파일시스템을 마운트하고 init을 시작합니다.
  4. init (systemd) – PID 1이며, 사용자 공간 서비스를 시작합니다.

2. Systemd (서비스 관리)

systemctl start nginx          # start now
systemctl enable nginx         # start on boot
systemctl status nginx         # view status
journalctl -u nginx            # view service‑specific logs

3. 모니터링 및 문제 해결

도구목적
top / htop실시간 CPU 및 메모리
df -h디스크 사용량
du -sh /path특정 디렉터리 크기
free -m메모리 요약
ps aux | grep <process>프로세스 찾기
kill -9 <pid>프로세스 강제 종료

Part 6 – 셸 스크립팅 (Bash)

Automation is the heart of DevOps.

#!/bin/bash
# -------------------------------------------------
# Example Bash script
# -------------------------------------------------

# Variables
NAME="DevOps Engineer"
DIR="/var/www/html"

# Conditionals
if [ -d "$DIR" ]; then
    echo "Directory exists."
else
    mkdir -p "$DIR"
    echo "Directory created."
fi

# Loops
for i in {1..5}; do
    echo "Iteration $i"
done

핵심 개념

개념설명
종료 상태$?0 = 성공, 0이 아닌 값 = 오류
인자$1, $2, … – 위치 매개변수
리다이렉션> 덮어쓰기, >> 추가, `

Part 7 – SSH 구성 및 보안

파일목적
/etc/ssh/sshd_configSSH 데몬 구성

보안 모범 사례 (하드닝)

  1. 루트 로그인 비활성화PermitRootLogin no 로 설정합니다.
  2. 비밀번호 인증 비활성화PasswordAuthentication no 로 설정합니다.
  3. 기본 포트 변경 (선택 사항) – 예: Port 2022.

키 기반 인증

# On the client
ssh-keygen -t rsa -b 4096          # generate key pair
ssh-copy-id user@remote-server    # copy public key to server

# On the server (verify permissions)
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Part 8 – Advanced Concepts & Cloud

1. Web‑Server Administration

ServerTypical UseMain Config Location
Nginx역방향 프록시 / 로드 밸런서/etc/nginx/sites-available/ ( sites-enabled 에서 링크됨)
Apache전통적인 웹 서버/etc/httpd/conf/httpd.conf (RHEL) 또는 /etc/apache2/apache2.conf (Debian)

Logs는 보통 /var/log/nginx/ 또는 /var/log/httpd/ 아래에 있습니다.

2. Reading Access Logs

  • File: /var/log/nginx/access.log
  • Purpose: 404/500 오류 디버깅.

3. Linux in the Cloud (AWS / Azure / GCP)

  • Cloud‑Init – 클라우드 인스턴스가 부팅될 때 한 번 실행되어 패키지를 설치하고 파일을 작성합니다.
  • Ephemeral Storage – 일부 클라우드 디스크는 인스턴스 종료 시 사라지므로 일시적인 특성을 인지해야 합니다.
  • Metadata Services – VM 내부에서 http://169.254.169.254에 요청하여 인스턴스 정보(IP, 지역 등)를 가져옵니다.

4. Text Processing (The “Swiss Army Knives”)

DevOps 엔지니어는 로그를 파싱할 때 다음 도구들을 자주 사용합니다:

  • grep – 텍스트 검색

    grep "error" file.log
  • awk – 특정 열 출력

    awk '{print $1}' file.txt
  • sed – 텍스트 찾고 바꾸기

    sed 's/old/new/g' file.txt

고급 Linux DevOps 학습을 위해 이 내용을 확인해 보세요.

Back to Blog

관련 글

더 보기 »