scp - deptno/deptno.github.io GitHub Wiki

scp

remote <-> local κ°„μ˜ 파일 전솑

scp -r [USER]@[HOST]:/path/to/remote/dir /path/to/local/dir
scp /path/to/local/file [USER]@[HOST]:/path/to/remote/dir

options

  • -r recursive, directory λ³΅μ‚¬μ‹œ μ‚¬μš©
  • -p preserve μˆ˜μ • μ‹œκ°„μ„ μ†ŒμŠ€λ‘œ μœ μ§€μ‹œν‚¨λ‹€
  • -i identity file, password λŒ€μ‹  key file μ§€μ •
  • -P port μ§€μ •, 22 κ°€ μ•„λ‹Œκ²½μš° μ‚¬μš©ν•œλ‹€.
  • -O

HOST λŠ” ~/.ssh/config λ₯Ό μ€€μˆ˜ν•œλ‹€. λ•Œλ¬Έμ— ssh-copy-id 등을 톡해 ν‚€λ₯Ό μ„€μ •ν•΄ 두면 λΉ„λ²ˆμ—†μ΄ νŽΈν•˜κ²Œ 볡사가 κ°€λŠ₯.

error

subsystem request failed on channel 0
scp: Connection closed

scp λͺ…λ Ήμ–΄κ°€ μ‹€νŒ¨ν–ˆλŠ”λ° 이 λ•ŒλŠ” -O μ˜΅μ…˜μ„ μΆ”κ°€ν•΄μ„œ μ„±κ³΅ν–ˆλ‹€.


link