본문 바로가기

Linux/기타

sftp 사용하기

[localhost@ ~]#ls /usr/local/openssh/libexec/ sftp-server ssh-keysign ssh-pkcs11-helper

sftp 는 기본적으로 지원하기 때문에 따로 설치할 필요 없다.

================================================================= OPENSSH-LAB> sftp 사용하기 !!! sftp 는 ssh 데몬을 실행시켜면 자동으로 동작을 한다. !!! !!! WinSCP 는 윈도우용 무료 클라이언트이다. !!! +--------+ +--------+ | | | | | Client | ---> | Server | | | | | +--------+ +--------+ root ---> user : topuser port : 22 Upload (put) -----> <----- Download (get) usage: sftp [-1246Cpqrv] [-B buffer_size] [-b batchfile] [-c cipher] [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-R num_requests] [-S program] [-s subsystem | sftp_server] host sftp [user@]host[:file ...] sftp [user@]host[:dir[/]] sftp -b batchfile [user@]host Client# sftp -P 22 sshuser@localhost <-- -P <포트번호> 참고 : 포트번호가 22일때 생략 가능 sshuser@localhost's password: <-- 비밀번호 입력 Connected to localhost. sftp> help <-- sftp 사용법 sftp> ls <-- 서버의 ls sftp> lls <-- 로컬의 ls sftp> put /etc/passwd <-- 서버의 sshuser 계정에 로컬의 /etc/passwd 업로드 sftp> pwd <-- 서버의 경로출력 Remote working directory: /home2/sshuser sftp> lpwd <-- 로컬의 경로출력 Local working directory: /root sftp> lls passwd <-- 로컬의 passwd 가 없다는 것은 아직 다운로드를 하지 않았기 때문이다. ls: passwd: No such file or directory Shell exited with status 2 sftp> get passwd <-- 서버에서 passwd 다운로드 Fetching /home2/sshuser/passwd to passwd /home2/sshuser/passwd 100% 2891 2.8KB/s 00:00 sftp> lls passwd <-- 다운로드한 후의 파일이 생성되었다. passwd =================================================================



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

scp 사용하기  (0) 2015.06.16
Xshell, ftp, editplus를 이용한 업로드하기  (0) 2015.06.16
ssh 를 이용한 터널링  (0) 2015.06.16
ssh 를 이용한 top 실행하기  (0) 2015.06.16
ssh 를 이용한 명령어 사용  (0) 2015.06.16