홈서버 및 Oracle 서버 세팅

홈서버와 Oracle cloud 서버를 초기화 하고 다시 세팅할 때 내 환경에 맞춰 쉽게 세팅할 수 있도록 기록한다. 한 줄 씩 실행하면 된다. 홈서버 (Debian 13) 첫 설치 시 lvm + luks2 설정하기 root 로그인 금지 # 사용자 관리자 권한 주기 sudo -i usermod -aG sudo <username> exit # 노트북 덮개 닫아도 절전되지 않게 sudo sed -i 's/^#\?HandleLidSwitch=.*/HandleLidSwitch=ignore/' /etc/systemd/logind.conf && sudo systemctl restart systemd-logind 초기 패키지 설치 # 업데이트 sudo apt update -y sudo apt upgrade -y # 패키지 설치 sudo apt install nala -y sudo nala install zsh git curl wget htop btop neofetch net-tools -y # Python 설치 sudo nala install python3 python3-pip python3-venv build-essential -y python3 --version # Node.js 설치 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" source ~/.bashrc nvm install node node -v; npm -v # 터미널 설정 sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.powerlevel10k echo 'source ~/.powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc source ~/.zshrc # p10k 초기 설정 sed -i 's/POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE=.*/POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE="%n"/' ~/.p10k.zsh && sed -i 's/POWERLEVEL9K_TIME_FORMAT=.*/POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"/' ~/.p10k.zsh && source ~/.p10k.zsh git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions 2>/dev/null || true; grep -q "zsh-autosuggestions" ~/.zshrc || echo -e "\n# zsh-autosuggestions\nsource ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc; source ~/.zshrc git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting 2>/dev/null || true; grep -q "zsh-syntax-highlighting" ~/.zshrc || echo -e "\n# zsh-syntax-highlighting\nsource ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc; source ~/.zshrc sudo nala install eza autojump -y grep -q "plugins=.*autojump" ~/.zshrc || sed -i -E 's/^plugins=\(([^)]*)\)/plugins=(\1 autojump)/' ~/.zshrc && source ~/.zshrc grep -q "alias ls='eza --icons --group-directories-first'" ~/.zshrc || echo -e "\n# eza aliases\nalias ls='eza --icons --group-directories-first'\nalias ll='eza -lah --icons --group-directories-first --no-user'\nalias lt='eza -T --icons'" >> ~/.zshrc; source ~/.zshrc # Docker 설치 sudo nala remove $(dpkg --get-selections docker.io docker-compose docker-doc podman-docker containerd runc | cut -f1) sudo nala update sudo nala install ca-certificates sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc printf "Types: deb\nURIs: https://download.docker.com/linux/debian\nSuites: $(. /etc/os-release && echo "$VERSION_CODENAME")\nComponents: stable\nSigned-By: /etc/apt/keyrings/docker.asc\n" | sudo tee /etc/apt/sources.list.d/docker.sources > /dev/null sudo nala update sudo nala install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y sudo usermod -aG docker $USER && newgrp docker 보안 설정 # ssh port 변경 sudo vi /etc/ssh/sshd_config # NEW_PORT에 원하는 포트 입력 NEW_PORT=2222; sudo sed -i "s/^#\?Port [0-9]*/Port $NEW_PORT/" /etc/ssh/sshd_config && sudo systemctl restart sshd # ssh key 설정 ssh-keygen -b 4096 # 로컬에서 실행 ssh-copy-id -p <port> -i <key> <username>@<host> # 로컬에서 실행 sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config && sudo sed -i 's/^#\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config && sudo sed -i 's/^#\?UsePAM.*/UsePAM no/' /etc/ssh/sshd_config && sudo systemctl restart sshd # 방화벽 설정 sudo nala install ufw -y sudo ufw allow <ssh port>/tcp sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw enable sudo grep -q "BEGIN UFW AND DOCKER" /etc/ufw/after.rules || echo -e "\n# BEGIN UFW AND DOCKER\n*filter\n:DOCKER-USER - [0:0]\n-A DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\n-A DOCKER-USER -j RETURN\nCOMMIT\n# END UFW AND DOCKER" | sudo tee -a /etc/ufw/after.rules > /dev/null sudo sed -i 's/^DEFAULT_FORWARD_POLICY=.*/DEFAULT_FORWARD_POLICY="ACCEPT"/' /etc/default/ufw sudo ufw disable && sudo ufw enable sudo iptables -L DOCKER-USER -n # DOCKER-USER 체인이 보이면 정상 적용됨 # ssh 방화벽 설정 sudo nala install fail2ban -y sudo systemctl enable fail2ban --now sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local # PORT에 ssh 포트 입력 PORT=2222; sudo awk -v p="$PORT" 'BEGIN{in=0} /^\[sshd\]/{print "[sshd]\nenabled = true\nport = " p "\nfilter = sshd\nlogpath = /var/log/auth.log\nbackend = systemd\nmaxretry = 3\nfindtime = 10m\nbantime = 1h"; in=1; next} /^\[.*\]/{in=0} !in{print}' /etc/fail2ban/jail.local 2>/dev/null | sudo tee /etc/fail2ban/jail.local >/dev/null sudo systemctl restart fail2ban sudo fail2ban-client status sshd

February 20, 2026 · 3 min · 571 words · Me

Rocky Linux 9에서 Python 3.14 설치

sudo dnf update -y sudo dnf upgrade -y sudo dnf groupinstall "Development Tools" -y sudo dnf install tar curl gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make findutils ncurses-devel xz-devel sqlite-devel readline-devel openssl-devel libuuid-devel -y cd ~ wget https://www.python.org/ftp/python/3.14.3/Python-3.14.3.tar.xz tar -xf Python-3.14.3.tar.xz cd ~/Python-3.14.3 ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" make -j $(nproc) sudo make altinstall python3.14 --version

December 25, 2025 · 1 min · 56 words · Me

Nginx Proxy Manager로 딥 웹(Tor)에 정적 사이트 서빙하기 🧅

Tor 설치 및 Nginx Proxy Manager 세팅 sudo dnf install tor services: app: image: 'docker.io/jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' - '81:81' - '443:443' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt 위와 같이 docker-compose.yml를 작성하고 컨테이너를 실행한다. http://<host>:81 에 접속해서 기본 세팅을 마무리한다. 정적 파일 서빙 할 컨테이너 세팅 services: hugo-static: image: nginx:alpine container_name: hugo-static volumes: - <정적 파일 디렉토리>:/usr/share/nginx/html:ro restart: unless-stopped networks: - npm_net ports: - "<외부 포트>:80" networks: npm_net: external: true docker compose up -d 리버스 프록시 생성 sudo -i cat /var/lib/tor/hidden_service/hostname .onion 도메인을 확인한 후, Nginx Proxy Manager 웹 UI에서 Proxy Hosts 메뉴로 이동 후 Add Proxy Host 버튼을 클릭한다. ...

December 8, 2025 · 1 min · 113 words · Me

Linux에서 Matrix Synapse 서버 설치하기

개요 이 글과 비슷한 내용이다. 나는 홈서버를 Xpenology 환경을 사용할 때도 있고 일반 리눅스 환경을 사용할 때도 있어서 다시 정리하는 글이다. Synology NAS가 아닌 일반 Linux 서버 환경에서 Docker를 활용해 Matrix Synapse 서버를 설치하는 방법을 다룬다. Synapse Homeserver 생성 mkdir {data,db};sudo docker run --rm \ -v ./data:/data \ -e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml \ -e SYNAPSE_SERVER_NAME=<서버 주소> \ -e SYNAPSE_REPORT_STATS=no \ matrixdotorg/synapse:latest generate homeserver.yaml 설정 수정 data 폴더 안의 homeserver.yaml 파일에서 server_name: "..." 밑에 다음 내용을 추가한다. enable_registration: true enable_registration_without_verification: true enable_group_creation: true database: name: sqlite3 args: database: /data/homeserver.db 위의 내용을 삭제하고 아래 내용으로 replace 한다. ...

October 30, 2025 · 2 min · 325 words · Me

스마트폰에 Debian 설치하기

23.11.28에 작성된 글입니다. 준비물 Android 스마트폰 PC 케이블 주의사항 가이드를 정확하게 따라오지 않으면 스마트폰이 부팅되지 않는 벽돌현상이 발생할 수 있다. 반드시 스마트폰의 모든 데이터를 백업한 후 진행해야 한다. 필자는 손실된 데이터에 대해 책임지지 않는다. 삼성 스마트폰 사용자라면 삼성 KNOX 워런티가 깨진다. 순정으로 복구해도 삼성 헬스, 삼성 페이 등 KNOX 관련 앱들을 **영구적으로 사용할 수 없게 된다. 스마트폰을 가볍게 이 작업은 선택사항이지만 더 가벼운 환경에서 서버를 사용하고 싶으면 진행할 것을 권장한다. 삼성의 OneUI, 샤오미의 MIUI (현 HyperOS), Oppo의 ColorOS 등의 사용자 인터페이스는 각 제조사 별 자체 기능과 개성을 더하기 위해 순정 Android를 개조하여 만든 것인데, 이 때문에 배터리가 빨리 닳거나 느려지는 현상이 발생할 수 있다. ...

June 16, 2025 · 3 min · 518 words · Me