본문 바로가기
C.W.K.
Stream
Lesson 02 of 06 · published

SSH Direct — 어디서나 통하는 기본 설정

~16 min · remote, ssh, ed25519, config

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

SSH Direct는 이미 갖고 있는 SSH 구성을 그대로 쓴다

가장 흔한 Remote 연결은 기존 SSH 키와 ~/.ssh/config, jump host를 재사용해. 별도 터널이나 독점 프로토콜이 필요 없어서 SSH로 접속할 수 있는 컴퓨터라면 세션 대상이 될 수 있어.

양쪽에 Claude Code를 설치하고 인증한 뒤 비밀번호 대신 키 기반 SSH를 준비해. ed25519 키가 기본 선택이고, 대상은 ~/.ssh/config의 별칭으로 관리하면 IP나 jump host가 바뀌어도 나머지 설정을 고칠 필요가 없어.

원격에 공개 키를 넣고 대상을 등록한 다음 claude remote pingclaude remote check로 연결과 복원 가능성을 시험해. 그 검사가 통과한 뒤 실제 세션을 넘기고 다시 가져오는 왕복까지 확인해야 설정이 끝난 거야.

직접 확인할 항목: claude remote add.

Code

SSH Direct를 처음부터 끝까지 설정하기·bash
# 1. Install Claude Code on the remote
ssh user@remote-host
npm install -g @anthropic-ai/claude-code
export ANTHROPIC_API_KEY=sk-ant-...
claude --login           # or set the env var permanently
exit

# 2. Generate / reuse an ed25519 key
ssh-keygen -t ed25519 -C "claude-remote" -f ~/.ssh/claude_remote
ssh-copy-id -i ~/.ssh/claude_remote.pub user@remote-host

# 3. ~/.ssh/config
cat >> ~/.ssh/config <<'EOF'
Host my-dev-server
    HostName 192.168.1.50
    User ubuntu
    IdentityFile ~/.ssh/claude_remote
    ServerAliveInterval 30
    ServerAliveCountMax 3
EOF

# 4. Register and verify
claude remote add my-dev-server
claude remote ping  my-dev-server
claude remote check my-dev-server     # version compatibility
실제로 세션 넘기기·bash
# Hand off the current session
claude remote handoff my-dev-server

# Hand off and immediately resume on the remote (new terminal)
claude remote handoff --resume my-dev-server

# Hand off targeting a specific project path
claude remote handoff --remote-path /home/ubuntu/myproject \
                      my-dev-server

# Hand back to local
claude remote handoff --back local

External links

Exercise

홈랩이나 저렴한 클라우드 VM, LAN에 있는 다른 Mac처럼 실제 원격 컴퓨터에 SSH Direct를 처음부터 끝까지 설정해. claude remote pingclaude remote check를 실행하고, 세션을 넘겨 원격에서 작업한 뒤 다시 가져와. 각 단계에 걸린 시간도 기록해.

Progress

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

댓글 0

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

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