본문 바로가기

Linux

SCP로 원격 컴퓨터에에 파일 전송하기

SCP로 원격 컴퓨터에 파일 전송하기



SCP(Secure CoPy)로 내 컴퓨터에 있는 파일을 서버로 전송해보자

당연한 이야기지만 scp[각주:1]가 ssh[각주:2]를 기반으로 하기에 원격지 컴퓨터가 ssh server를 실행하고 있어야 한다


인증 파일이 필요한 경우는 ssh와 마찬가지로 "scp -i 파일경로" 형태로 명령을 시작하면 된다




기본 예제


간단한 이동 예제다


scp foo.txt bar.txt your_username@remotehost.edu:~
scp {foo,bar}.txt your_username@remotehost.edu:~
scp *.txt your_username@remotehost.edu:~


만약 인증에 인증서가 필요하다면 아래와 같이 하면 된다


scp -i my_credential.pem foo.txt ubuntu@aws.com:~





추가 예제 (http://www.hypexr.org/linux_scp_help.php)



서버에 있는 foobar.txt를 내 컴퓨터에 저장


scp your_username@remotehost.edu:foobar.txt /some/local/directory

내 컴퓨터에 있는 foobar.txt를 서버에 저장


scp foobar.txt your_username@remotehost.edu:/some/remote/directory

foo디렉토리 통째로 서버에 저장


scp -r foo your_username@remotehost.edu:/some/remote/directory/bar


  1. Secure Copy Protocol [본문으로]
  2. Secure Shell [본문으로]

'Linux' 카테고리의 다른 글

Linux mint 17.3으로 업데이트  (0) 2015.12.11
Linux 4.2에 VMware player 7 설치하기  (0) 2015.11.25
SSH로 원격 컴퓨터에 접속하기  (0) 2015.11.17
QCA61x4 not working  (0) 2015.11.13
Linux mint 17.2 Kernel Update  (0) 2015.11.13