[Linux]SCP 파일전송

BackEnd_Ash.log·2020년 9월 2일
0

scp

scp 명령어

  • scp : secure copy (remote file copy program) 의 줄임말로 ssh 를 이용해 네트워크로 연결된 호스트간에 파일을 주고 받는 명령어 입니다.

  • 로컬-> 리모트(보내기) , 리모트->로컬(가져오기)리모트->리모트(다른 호스트까지 전송) 로 복사가 모두 가능합니다.

  • ssh 를 이용하기 때문에 password 를 입력하거나 ssh 키 파일과 같은 identify file 을 이용해 파일 송수신이 가능합니다.

기본 사용 문법

  • manual page 에 있는 자료
scp [options...][source][target]
  • 기본 형태
# Local -> Remote
scp 목적파일명(경로) 유저명@ip주소:목적디렉토리
# Remote -> Local
scp 유저명@IP주소:파일디렉토리 목적파일명(경로)
# Remote(source) -> Remote(target)
scp 유저명@IP주소 : 파일 디렉토리 유저명@IP주소 : 파일디렉토리

local -> remote

  • use password
scp ~/text.dump test@[ip address]:/home/
  • -r option
  • 폴더를 복사하는 경우
scp -r ~/folder_name/ test@[ip address]:/home

remote -> local

  • password use
scp test@[ip address]:/home/ /jakdu/django/
- `-i` option
- identity file 을 지정해서 사용할 때
  • -r option
  • 폴더를 복사하는 경우
scp -r test@[ip address]:/home /jakdu/django
profile
꾸준함이란 ... ?

0개의 댓글