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

SFTP

~12 min · sftp, interactive, ftp-like

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

SSH 의 인터랙티브 파일 브라우저

sftp 가 SSH 위로 FTP 같은 인터랙티브 세션 줘. 한 번 연결하고 익숙한 셸 명령으로 원격 파일시스템 탐색 — ls, cd, get, put. 정확한 path 모르고 둘러보고 싶을 때 유용.

로컬 vs 원격 명령

sftp 세션 안에서 prefix 없는 명령은 원격 쪽 작동. l 접두사 (lls, lcd, lpwd) 가 로컬 쪽 작동. get 다운로드, put 업로드. Tab completion 양쪽 다 동작.

GUI 클라이언트가 이 프로토콜 사용

Cyberduck, Transmit, FileZilla 다 SFTP. SSH host (옵션으로 ~/.ssh/config alias) 로 설정하면 원격 파일시스템을 로컬 Finder 창처럼 다룸. SSH config 와 같은 인증.

Code

SFTP 기초·bash
# Connect via host alias from ~/.ssh/config
sftp office

# Inside the sftp session
sftp> ls           # remote listing
sftp> lls          # local listing
sftp> cd /var/log  # navigate remote
sftp> lcd /tmp     # navigate local
sftp> get system.log         # download to local cwd
sftp> put report.pdf         # upload from local cwd
sftp> mkdir backup
sftp> rm old.log
sftp> bye          # exit

External links

Exercise

접근 가능한 host 에 sftp 돌려. 파일 여러 개 있는 디렉토리로 navigate, 목록, get 으로 하나 다운로드, 다른 파일 put 으로 업로드. 로컬 (lls/lcd) 과 원격 (ls/cd) 의식적으로 전환. bye 로 exit. 정확한 path 모를 때 답이 SFTP — 복사 명령 아니라 navigable 파일 브라우저.

Progress

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

댓글 0

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

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