SSH सुरक्षा गाइड
SSH 보안 강화
서버 접속의 첫 관문, SSH를 안전하게 설정하는 방법입니다.
기본 보안 설정
# /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
ClientAliveInterval 300
SSH 키 관리
# 키 생성 (Ed25519 권장)
ssh-keygen -t ed25519 -C "my-server"
# 서버에 키 복사
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
# SSH config 설정
Host my-server
HostName 10.0.0.1
User ubuntu
IdentityFile ~/.ssh/id_ed25519
Port 22
fail2ban 설정
sudo apt install fail2ban
sudo systemctl enable fail2ban
키 기반 인증 + fail2ban 조합이면 99%의 브루트포스 공격을 차단할 수 있습니다.