Dorulog
article thumbnail
반응형

SCP란?

SCP는 Secure file copy프로그램을 총칭하는데요.

Secure copy의 약자입니다. 즉 말그대로 보안전송이 가능한 복사 프로그램입니다.

시큐어 카피 또는 SCP는 로컬 호스트와 원격 호스트 간 또는 두 개의 원격 호스트 간에 컴퓨터 파일을 안전하게 전송하는 수단이다. 시큐어 셸 프로토콜 기반이다. SCP라는 용어는 SCP 프로토콜 또는 SCP 프로그램 중 하나를 가리킬 수 있다

PSCP 

Putty 프로젝트를 제작한 곳에서 제작한 윈도우용 SCP프로그램입니다.

파일 다운로드 링크 

 

Download PuTTY: latest release (0.76)

This page contains download links for the latest released version of PuTTY. Currently this is 0.76, released on 2021-07-17. When new releases come out, this page will update to contain the latest, so this is a good page to bookmark or link to. Alternativel

www.chiark.greenend.org.uk

공식홈페이지 하단에 Alternative binary files에서 다운로드 가능합니다.

PSCP 사용법

PSCP는 명령어를 통해서 파일 업/다운로드가 가능합니다.

공식 메뉴얼 링크

 

Using PSCP to transfer files securely

Previous | Contents | Index | Next Chapter 5: Using PSCP to transfer files securely PSCP, the PuTTY Secure Copy client, is a tool for transferring files securely between computers using an SSH connection. If you have an SSH-2 server, you might prefer PSFTP

the.earth.li

먼저 path를 설정하면 어디서나 CMD를 통해서 사용 가능합니다.

Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -p        preserve file attributes
  -q        quiet, don't show statistics
  -r        copy directories recursively
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -P port   connect to specified port
  -l user   connect with specified username
  -pw passw login with specified password
  -1 -2     force use of particular SSH protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -batch    disable all interactive prompts
  -unsafe   allow server-side wildcards (DANGEROUS)
  -sftp     force use of SFTP protocol
  -scp      force use of SCP protocol

기본적인 사용법은 pscp 파일다운받을 위치 내려받을 위치

이렇게 사용이 가능하구요.

가이드에서와 같이 fred라는 계정으로 example.com 도메인의 /etc/hosts 파일을

c:\temp\examle-hosts.txt로 내려받는 코드입니다.

pscp fred@example.com:/etc/hosts c:\temp\example-hosts.txt

실제로 제가 저번에 만든 오라클 서버에서 파일을 내려받고 올려받는 코드를 작성해보겠습니다.

-i 옵션은 개인키가 있을 경우 써줘야 하구요.

아래와 같이 python.ppk라는 개인인키로, ubuntu 계정의 152의 서버의 Audit.xlsx 파일을

F:\백업\oracle 폴더에 내려받는 명령어입니다.

아래에서 진행률이 나오고 ETA는 실행시간입니다.

업로드 역시 동일합니다.

반대로 F:\백업\oracle에 위치한 Audit.xlsx를 업로드 하는 명령어입니다.

이때 패스워드를 입력해주셔야 동작합니다.

실제로 어렵지 않게 간단하게 명령어로 실행이 가능합니다.

물론 FTP 프로그램 등으로 사용하면 더 편리하나 서버에 별도로 ftp를 설치하지 않아도 되고

배치파일로 활용이 가능하는 등 다양하게 활용이 가능합니다.

그럼 잘사용하세요.

728x90
profile

Dorulog

@dorudoru

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!