C.W.K.
Stream
Lesson 04 of 14 · published

Port 변경 — 노이즈, 보안 X

~10 min · sshd, non-default-port, obscurity

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

왜 SSH 를 22 에서 옮기나

SSH 를 non-default port (2222, 22022, 기억할 만한 거) 로 옮기는 거 진짜 보안 X — 스캐너가 몇 초 안에 찾음. 근데 백그라운드 노이즈 극적으로 감소. Public-facing 서버 :22 가 매일 수천 brute-force 시도; :2222 가 한 줌. Key-only 인증 있으면 둘 다 동등 안전; 후자가 그냥 wade through 할 로그 노이즈 적음.

이 트랙 나머지와 결합

Port 변경 자체는 연극. Key-only 인증 + fail2ban + 방화벽 (다음 레슨) + 제한된 user 목록과 결합하면 — 조용하고 brute-force 저항하고 찾기 어려운 서버. 각 layer 작아; 결합이 중요한 거.

Code

Listening 포트 변경·bash
# Edit
sudo nano /etc/ssh/sshd_config
# Change:
#   #Port 22
# To:
#   Port 2222

# ALWAYS validate before restarting
sudo sshd -t

# Restart
sudo systemctl restart sshd
참조되는 모든 곳 업데이트·bash
# Open the new port in the firewall
sudo ufw allow 2222/tcp
sudo ufw delete allow 22/tcp   # close the old one only after testing the new

# fail2ban: update the jail's `port = ssh` if you're using a non-named port
#   port = 2222

# Your ~/.ssh/config:
# Host server
#     Port 2222

# Connect manually
ssh -p 2222 user@host

# Or via scp (note CAPITAL P)
scp -P 2222 file.txt user@host:/tmp/

External links

Exercise

테스트 서버 (유일한 원격 박스 X) 에서 위 step 따라 SSH 22 → 2222. Validate (sshd -t), 재시작, 새 터미널에서 테스트, 그다음 방화벽에서 22 닫기. ~/.ssh/config Host block 을 Port 2222 로 업데이트해 -p 그만 치게. 다음 날 auth log 봐 — 노이즈 drop 극적.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.