linux class 2 페이지

본문 바로가기
사이트 내 전체검색


회원로그인

linux class

ftp 서비스 - client

페이지 정보

작성자 admin 작성일15-12-23 15:25 조회126회 댓글0건

본문

ftp 서비스
- file transfer protocol을 의미하며 호스트간에 file 송수신을 하기 위한 프로토콜 및 서비스를 의미한다.
- 송수신 하는 파일은 이진형식과 바이너리 형식 두가지 형식이 있다.

GUI 환경에서의 ftp client 전용 프로그램으로는
알ftp , 파일질라 등이 있다.

* command line 에서 ftp client 사용법.
 
[root@star tmp]# ftp
ftp> ?  <= ftp prompt 에서 ? 를 입력하면 command 목록을 볼수 있다.

Commands may be abbreviated.  Commands are:

!              cr              mdir            proxy          send
$              delete          mget            sendport        site
account        debug          mkdir          put            size
append          dir            mls            pwd            status
ascii          disconnect      mode            quit            struct
bell            form            modtime        quote          system
binary          get            mput            recv            sunique
bye            glob            newer          reget          tenex
case            hash            nmap            rstatus        trace
ccc            help            nlist          rhelp          type
cd              idle            ntrans          rename          user
cdup            image          open            reset          umask
chmod          lcd            passive        restart        verbose
clear          ls              private        rmdir          ?
close          macdef          prompt          runique
cprotect        mdelete        protect        safe
ftp> help bin  <= 각 명령어에 대한 간단한 설명을 보려면 'help 명령어' 하면 된다.
binary          set binary transfer type
ftp>

이중에서 자주 사용되는 명령은

*.명령은 줄여쓸수 있다.

! : ftp 프롬프트에서 셀명령어를(로컬 명령어) 쓸수 있다.
ascii : 전송모드를 ascii 타입으로 지정
bin(binary) : 전송모드를 binary 모드로 지정 => 아스키 파일을 송수신 하는 경우가 아니면 전송모드는
                                                                      전부 바이너리 모드로 해야 한다.
get : 하나의 파일을 다운로드
mget : 여러개의 파일을 다운로드
cd : 디렉토리 변경
mkdir : 디렉토리 생성
rmdir : 디렉토리 삭제
hash : 파일송수신시 '#' 마크를 찍어서 전송상태 표시해준다.
close : 접속 끊기
quit: ftp 를 끝내고 shell 로 돌아간다.
user : 로그인시 id 나 암호가 틀렸을때 다시 입력하는 명령어
lcd : 서버가 아닌 클라이언트의 현재 디렉토리를 변경하는 명령어
ex) lcd  /tmp => 클라이언트의 현재 작업경로를 /tmp 로 변경.



ex) ftp 서버에 익명계정(anonymous) 접속 방법.
(*. 탐색기나 웹브라우저에서는 --> ftp://ftp서버주소)

centos2[testuser /home/testuser]$ ftp centos
Connected to centos (172.20.6.101).
220 (vsFTPd 2.0.5)
Name (centos:testuser): anonymous
331 Please specify the password.
Password:    <---- 그냥 엔터(anonymous 계정은 암호가 없음)
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"  <== 실제 / 디렉토리는 아니며 anonymous 계정의 홈디렉토리
ftp> ls
227 Entering Passive Mode (172,20,6,101,132,83)
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Jan 09  2013 pub
226 Directory send OK.
ftp>
ftp> quit
221 Goodbye.
---------------------------------------------------------------------------
* local account 접속 및 파일전송
(*. 탐색기나 웹브라우저에서는
1. 접속하려는 ftp 서버가 익명 계정 접속을 허용하지 않는 경우 --> ftp://ftp서버주소
2. 접속하려는 ftp 서버가 익명 계정 접속을 허용하는 경우 --> ftp://user1@ftp서버주소 )

centos2[testuser /home/testuser]$ ftp centos
Connected to centos (172.20.6.101).
220 (vsFTPd 2.0.5)
Name (centos:testuser):
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> user    <== id 나 암호가 틀린경우 user 를 입력.
(username) testuser
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> user
(username) user1
331 Please specify the password.
Password:
230 Login successful.
ftp> pwd
257 "/home/user1"
ftp> cd /etc
250 Directory successfully changed.
ftp> pwd
257 "/etc"
ftp> lcd  /tmp  <== local 디렉토리를 /tmp 로 변경
Local directory now /tmp
ftp> ! pwd  <== linux shell 명령어 실행(local 명령어)
/tmp  <== local 의 현재위치.
ftp> ls issue*
227 Entering Passive Mode (172,20,6,101,225,131)
150 Here comes the directory listing.
-rw-r--r--    1 0        0              47 Jan 11  2013 issue
-rw-r--r--    1 0        0              46 Jan 11  2013 issue.net
226 Directory send OK.
ftp> ascii
200 Switching to ASCII mode.
ftp> ! mkdir download  <== linux shell 명령어(local)
ftp> lcd download  <== 로컬 현재 디렉토리 변경
Local directory now /tmp/download
ftp> get issue  <== 파일 다운로드
local: issue remote: issue
227 Entering Passive Mode (172,20,6,101,191,68)
150 Opening BINARY mode data connection for issue (47 bytes).
WARNING! 3 bare linefeeds received in ASCII mode
File may not have transferred correctly.    <== ftp 서버가 binary 모드 전송 허용 안함으로
                                                                    되어 있음. 
226 File send OK.      <== 파일 다운로드는 성공.
47 bytes received in 0.000248 secs (189.52 Kbytes/sec)
ftp> ! ls  <== 로컬 명령어
issue    <== 로컬의 현재디렉토리(/tmp/download)에 다운로드 되어 있음.
ftp> quit

댓글목록

등록된 댓글이 없습니다.


접속자집계

오늘
131
어제
75
최대
611
전체
448,181
개인정보취급방침 서비스이용약관 twoseven.kr All rights reserved.
상단으로