C.W.K.
Stream
Lesson 05 of 12 · published

ProxyJump

~15 min · proxyjump, bastion, jump-host, ssh-tunnel

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

Bastion 통한 hop

ProxyJump 가 중간 host ("jump host" 또는 "bastion") 통해 먼저 연결해서 target host 도달. 인터넷에서 직접 도달 안 되는 internal server — bastion SSH, 거기서 internal 로. ProxyJump 가 두 단계 자동화.

커맨드라인 vs config

임시는 -J, ~/.ssh/configProxyJump directive 로 박을 수도.

Agent forwarding 보다 나은 이유

Bastion 통한 hop 두 방법:

  • Agent forwarding(-A) — 로컬 agent socket 이 bastion 에 노출. Root 가진 사람이 다른 곳 너 행세.
  • ProxyJump(-J / ProxyJump) — 로컬 SSH 클라이언트가 bastion 통한 TCP 터널 열고, target 과 새 SSH 협상. Bastion 은 암호화된 바이트만 셔플; 키가 사용 가능한 형태로 bastion 에 안 들어감.

ProxyJump 디폴트로. ProxyJump 진짜 안 맞고 bastion 완전 신뢰할 때만 agent forwarding.

Code

커맨드라인 & config·ssh-config
# ~/.ssh/config

# The bastion (publicly reachable)
Host bastion
    HostName bastion.example.com
    User you_username
    Port 2222
    IdentityFile ~/.ssh/id_ed25519

# Internal target — only reachable through bastion
Host internal-server
    HostName 10.0.0.50
    User you_username
    ProxyJump bastion

# Multi-hop — through two bastions
Host deep-target
    HostName 10.10.10.10
    User you_username
    ProxyJump hop1,hop2
scp 와 rsync 그냥 동작·bash
# Now this two-hop is invisible:
ssh internal-server

# scp through the jump
scp file.txt internal-server:/tmp/

# rsync through the jump
rsync -avz ./project/ internal-server:/home/you_username/project/

# One-shot CLI ProxyJump
ssh -J bastion 10.0.0.50
ssh -J hop1,hop2 deep-target

External links

Exercise

Bastion 스타일 셋업 (클라우드 VPC, 회사 네트워크) 있으면 ProxyJump 쓰는 block config 에 추가. 없으면 LAN 에서 시뮬레이트 — ssh internal 이 실제로 ProxyJump office 통해 ssh office 먼저 거치게. ssh internal 이 전과 정확히 똑같이 동작하는지 테스트. 핵심은 로컬 근육 기억 — hop 이 보이면 안 됨.

Progress

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

댓글 0

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

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