빠른 참조

scp 명령어 SSH 기반 보안 파일 전송 치트시트

scp 명령어 퀵 가이드: SSH 기반 원격 파일 송수신, 디렉터리 재귀 복사(-r), 포트 지정(-P), 대역폭 제한(-l) 및 키 파일 지정(-i).

· 게시일

Basic Command Syntax

scp [options] source destination

Common Transfer Examples

# Upload local file to remote server
scp report.pdf [email protected]:/var/data/

# Download remote file to current local directory
scp [email protected]:/var/data/report.pdf .

# Transfer an entire directory recursively (-r)
scp -r ./dist/ [email protected]:/var/www/site/

# Transfer between two remote servers via local workstation
scp [email protected]:/data/db.dump [email protected]:/data/

Useful Options

Option Description
-P <port> Specify custom SSH port (e.g. -P 2222)
-r Recursively copy entire directories
-C Enable compression during transfer
-p Preserve modification times, access times, and permissions
-l <limit> Limit bandwidth in Kbit/s (e.g. -l 800)
-v Verbose debug output

References

관련 주제