본문 바로가기

Linux/기타

scp 사용하기

==================================================================== OPENSSH-LAB> scp 사용하기

!!!! 반드시 호스트명 or IP 주소 뒤에 :(콜론)을 붙여야 한다. !!!!

+--------+ +--------+ | | | | | Client | ---> | Server | | | | | +--------+ +--------+ root ---> user : sshuser port : 22 Upload -----> <----- Download **** scp 는 포트번호가 22번이 아니면 -P(대문자) 옵션을 사용한다. **** **** 보안상 서버가 포트번호 22 를 다른 포트 (2200) 로 변경할때는 **** alias 를 이용하면 편리하게 접속할 수 있다. **** # alias scp='scp -P2200' usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2 조건1 : /etc/passwd Upload : C ---> S Dowonload : C <--- S - Upload (/etc/passwd 파일을 sshuser@localhost로 복사) # scp /etc/passwd sshuser@localhost: - Dowonload (sshuser@localhost:passwd 파일을 /tmp 로 복사) # scp sshuser@localhost:passwd /tmp - Upload (/etc 디렉토리를 sshuser@localhost 몽땅 복사) - -r 옵션은 디렉토리를 복사할때 사용한다. # scp -r /etc sshuser@localhost: - Dowonload (sshuser@localhost:etc 디렉토리를 몽땅 /tmp로 복사) - -r 옵션은 디렉토리를 복사할때 사용한다. # scp -r sshuser@localhost:etc /tmp ====================================================================


'Linux > 기타' 카테고리의 다른 글

공개키 인증방식으로 접속  (0) 2015.06.17
ssh란?  (0) 2015.06.17
Xshell, ftp, editplus를 이용한 업로드하기  (0) 2015.06.16
sftp 사용하기  (0) 2015.06.16
ssh 를 이용한 터널링  (0) 2015.06.16