'FTP server'에 해당되는 글 1건


Linux ftp server 설치 및 사용법

   

리눅스가 9.x로 변화하면서 anonymous ftp 서버가 proftpd로 변경되었다.

 
    1. 
Linux FTP설치
 

        - 
anonymous ftp가 설치 되어 있지 않다면 여러분은 다음의 두 파일을 다운 받아 설치 해야 한다.

          
-anonftp-2.9-4ac.i386.rpm
          
-proftpd-1.2.0pre9-3ac.i386.rpm
 

  1. xxxxxxxxx.tar.gz, gz으로 압축된 파일이다. 주로 리눅스상에서 압축을 풀고 사용한다.
  2. xxxxxxxxx.src.rpm, 소스rpm파일이다. 소스 내용을 일부 수정해서 사용할 수 있다.
  3. xxxxxxxxx.i386.rpm, 소스 내용을 수정할 수 없는 패키지이다. i386은 인텔 i386호환기종을 말한다.
    대부분의 시스템들이 인텔 호한칩을 사용하고 있으므로 요걸 다운 받는다.

   

  • 이 파일 중에서anonyftp는 /home/ftp라는 디렉토리를 만들고 기본적인 ftp가 운용되도록 설정을 해주는 것이며 profptd는 anonymous로 접속하는 사용자들을 제어하고 anonymous서비스를 제공하는 ftp서버 프로그램이다.

    <rpm 설치 명령어>

    • #rpm -Uvh RPM_Name.rpm

         

    -패키지 설치확인 명령어-

    • #rpm -qa | grep 패키지 명

       

    -강제설치- 

    • #rpm --nodeps -Uvh 패키지.rpm
       
2. Linux FTP설정 

  - ftp서버도 마찬가지이다. conf파일만 수정하는 것으로 바로 운용이 가능하다.

  
다음 파일은 /etc/proftpd.conf의 내용이다.(OS 버전 별로 다를 수 있음.) 

[root@rootshell /root]#vi /etc/proftpd.conf

  

   

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName         "dacker.net"
ServerType         standalone
DefaultServer on

여기서 Server Name은 여러분의 ftp서버명을 말한다.
또한 서버타입은 standalone으로 하는 것이 슈퍼데몬(inetd)에 영향을 주지 않고 좋다.

# Use Pam Module (required /etc/pam.d/ftp)
# please read /usr/doc/proftpd-1.2pre3/mod_pam.c
#
AuthPAMAuthoritative on
사용자 인증에서 PAM을 사용할 것인지를 명시
# Port 21 is the standard FTP port.
Port                                21
기본 포트번호 21 반드시 외워라
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                                022
파일을 생성하게 되면 기본적으로 주어지는 퍼미션을 umask라 한다.
022라고 설정 되어 있다면 퍼미션 644(-rw-r--r--)을 뜻한다.

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances                        30
자식 프로세스 최대 생성수지정. 바람직하지 못한 서비스
공격 방지 , 수 초과시 log기록 연결 해제
# Set the user and group that the server normally runs at.

User                                nobody
Group                                nobody

proftpd 데몬을 실행시키는 사용자와 그룹 설정
# To show all filenames including ``dot'' files
#LsDefaultOptions "-a"

#
# To allow root login
# be sure to take root out from /etc/ftpusers also :)
#
#RootLogin on
RootLogin off
root 계정으로 로그인, 보안에 좋지 않음 항상off로 해놓을 것

# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite                on
새로운 파일명이 기존의 파일명과 같을 경우 덮어쓰기 허용
</Directory>

# A basic anonymous configuration, no upload directories.
<Anonymous ~ftp>

User                                ftp
Group                                ftp
RequireValidShell off
익명사용자로 접근 가능 설정
# We want clients to be able to login with "anonymous" as well as "ftp"
UserAlias                        anonymous ftp
anonymous,ftp로 로그인 가능

# Limit the maximum number of anonymous logins
MaxClients                        10
매직 쿠기이용 메세지 삽입가능
("죄송합니다. 현재 사용인원은 %M입니다. 다음을 이용해 주십시요")
최대 접속가능 클라이언트 제한 none으로 설정하면 무제한 접속가능

# Limit the maximum number per host
# MaxClientsPerHost 1
동일한 사용자가 접속을 끊고 제접속할 수 있는 횟수
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.

DisplayLogin                        welcome.msg
로그인시 보여줄 문서 파일 welcome.msg

DisplayFirstChdir                .message

디렉토리 이동시 보여줄 문서 파일 .message
# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
익명사용자 쓰기금지 설정
# Upload directory, allow upload and mkdir and deny download
#
# <Directory incoming>
# <Limit READ>
# DenyALL
# </Limit>
# <Limit STOR MKD>
# AllowALL
# </Limit>
# </Directory>
업로드 디렉토리 생성시 다운로드 금지, 업로드 디렉토리
생성 가능 설정
</Anonymous>

자 설정이 끝났으면 데몬을 재실행하자(윈도우에서 프로그램 설치 후 리부팅하는
것을 기억하는가
리눅스에서는 데몬에 관한 내용을 설정 후 데몬을 재 실행 시켜야만 한다.)


3. Proftpd Start/Stop

[root@rootshell /root]# /etc/rc.d/init.d/proftpd stop
shutting down ProFTPD [ok]
[root@rootshell /root]# /etc/rc.d/init.d/proftpd start
starting ProFTPD [ok]

  

 
         4. FTP 사용법

        4-1 리눅스

  • # Ftp 192.168.xxx.xxx
  • Username 입력
  • Password 입력

  

   

   

4-2 윈도우(cmd창)

  • 방화벽으로 인하여 접속이 않될 경우가 있음.(방화벽 해제)

       

  • # Ftp 192.168.xxx.xxx
  • Username 입력
  • Password 입력

  

   

   

   

4-3 FTP 명령어들..

1) ls, dir : ftp의 폴더 목록이나 파일 목록을 보여준다.

2) cd : 해당 폴더의 내부로 들어가기 위해서 cd 폴더명 을통해 폴더를 접근한다.

3) get : 파일을 받는 명령어 이다. get 파일명 을 적어주면 파일을 받을수있다.

4) mget : 파일을 여러개 받는 명령어 이다.

5) put : 파일을 업로드 한다. put 파일명을 적어주면 된다.

6) mput : 파일 여러개를 함께 올리는 명령어 이다.

7) hash : 파일 업/다운 로드의 진행 상황을 보여준다

8) bye or quit : ftp를 끝낸다.

9) help : 명령어의 전체보기

   

   

   

참고자료

원본 위치 <http://blog.iizs.net/6010654 >

원본 위치 <http://www.webtoedu.com/menu2_4.html>

원본 위치 <http://superuser.org/linux/dacker/page04.htm>

원본 위치 <http://cafe.naver.com/ArticleRead.nhn?articleid=909&sc=e0d2361c0e40259b12&query=cmd+ftp+%B8%ED%B7%C9%BE%EE&clubid=16566486>

블로그 이미지

운명을바꾸는자

IT와 함께 살아가는 삶

,