scp
: secure copy (remote file copy program) 의 줄임말로 ssh
를 이용해 네트워크로 연결된 호스트간에 파일을 주고 받는 명령어 입니다.
로컬-> 리모트(보내기)
, 리모트->로컬(가져오기)
와 리모트->리모트(다른 호스트까지 전송)
로 복사가 모두 가능합니다.
ssh
를 이용하기 때문에 password 를 입력하거나 ssh 키 파일과 같은 identify file 을 이용해 파일 송수신이 가능합니다.
scp [options...][source][target]
# Local -> Remote
scp 목적파일명(경로) 유저명@ip주소:목적디렉토리
# Remote -> Local
scp 유저명@IP주소:파일디렉토리 목적파일명(경로)
# Remote(source) -> Remote(target)
scp 유저명@IP주소 : 파일 디렉토리 유저명@IP주소 : 파일디렉토리
scp ~/text.dump test@[ip address]:/home/
-r
optionscp -r ~/folder_name/ test@[ip address]:/home
scp test@[ip address]:/home/ /jakdu/django/
- `-i` option
- identity file 을 지정해서 사용할 때
-r
optionscp -r test@[ip address]:/home /jakdu/django