메뉴 건너뛰기

컴퓨터공학부 박진우연구원의 홈페이지에 오신것을 환영합니다.

자료실

mysql proftp 연동

mysql과  proftp 연동설정 정리

 

이 연동 자료는 2010 인미기초실습 수강생은 참조하지 말기 바랍니다.

아직 여기의 내용을 이해할 정도로 진도가 나가지 않았습니다.

그냥 기본 프로그램을 다운받아 make;   make install 해서 설치하기 바랍니다.

또는 yum 으로 설치하기 바랍니다.

 

 

 

 

 

작성일시 : 2005.08.19

작성자 : 이승호

1. mysql 기본설치

설치버젼 mysql-4.0.24.tar.gz

2. proftp 소스 설치 옵션 부여

설치 버젼 proftpd-1.2.10.tar.gz

    * configure 도중 헤더와 라이브러리 화일의 위치를 찾을수 없다고 나오면 아래와 같이 링크 시켜준다.

ln -s /usr/local/mysql/include/mysql /usr/include/mysql
ln -s /usr/local/mysql/lib/mysql/libmysqlclient.a /usr/lib/libmysqlclient.a
ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.12.0.0 /usr/lib/libmysqlclient.so.12

    * configure 옵션

./configure --prefix=/usr/local/proftpd --with-modules=mod_sql:mod_sql_mysql \
          --with-includes=/usr/include/mysql --with-libraries=/usr/lib \
  --enable-autoshadow --enable-shadow
에러 없을시 make && make install

3. 데이터베이스 스키마

   * users
create table users (
      userid   char(12) not null,
      uid      integer unsigned,
      gid      integer unsigned,
      passwd   char(63),
      shell    char(255),
      homedir  char(255),
      count    integer unsigned not null,
      valid    integer unsigned,
      primary key (userid)
    );

   * groups
     create table groups (
     gname    char(12) not null,
     gid      integer unsigned,
     members  text,
     primary key(gname)
   );

4. Proftp 설정

  # 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                      "ProFTPD Default Installation"
  ServerType                      standalone
  DefaultServer                   on

  # Port 21 is the standard FTP port.
  Port                            21

  # Umask 022 is a good standard umask to prevent new dirs and files
  # from being group and world writable.
  Umask                           022

  # 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
  ServerIdent off
  UseReverseDNS off
  IdentLookups off
  DefaultRoot ~

  # Set the user and group under which the server will run.
  User                            nobody
  Group                           nobody

  # To cause every FTP user to be "jailed" (chrooted) into their home
  # directory, uncomment this line.


  # Normally, we want files to be overwriteable.
  AllowOverwrite          on

  # Bar use of SITE CHMOD by default
  <Limit SITE_CHMOD>
    DenyAll
  </Limit>

  # MYSQL


  SQLConnectInfo proftp@localhost:3306 proftp bwing1004
  SQLUserInfo                     users userid passwd uid gid homedir shell
  SQLUserWhereClause              "valid = 1"
  SQLLog                          PASS updatecount
  SQLNamedQuery updatecount UPDATE "count=count+1 where userid='%u'" users
  SQLAuthTypes                    Backend
  SQLAuthenticate                 users
  SQLDefaultGID                   65534
  SQLDefaultUID                   65534
  SQLMinUserGID                   100
  SQLMinUserUID                   500
  SQLDefaultHomedir /usr/local/mysql/data
  SQLNamedQuery count SELECT "count from users where userid='%u'"
  SQLShowInfo PASS "230" "%u님은 지금까지 %{count}번 접속하셨습니다."
  SQLLogFile              /var/log/proftp_sql.txt

  # A basic anonymous configuration, no upload directories.  If you do not
  # want anonymous users, simply delete this entire <Anonymous> section.
  #<Anonymous ~ftp>
  #  User                         ftp
  #  Group                                ftp
  #
  # We want clients to be able to login with "anonymous" as well as "ftp"
  #  UserAlias                    anonymous ftp
  #
  # Limit the maximum number of anonymous logins
  #  MaxClients                   10
  #
  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  #  DisplayLogin                 welcome.msg
  #  DisplayFirstChdir            .message
  #
  # Limit WRITE everywhere in the anonymous chroot
  #  <Limit WRITE>
  #    DenyAll
  #  </Limit>
  #</Anonymous>

5. 사용자 생성 Query

insert into users values ('userID',uid,gid,PASSWORD('비밀번호'),'shell','homedir',count,valid);
     예) insert into users values ('admin',NULL,NULL,PASSWORD('admin1004'),'/bin/sh','/home/admin',0,1);

6. 기타 설정 사항

* 사용자 디렉토리 퍼미션 777 되있어야 데이터 업로드 가능
* group 테이블을 사용하지 않으면 SQLAuthenticate users 로 바꿔서 사용

7. proftp 설정에 관한 설명

* SQLConnectInfo        DB명@호스트:포트 아이디 패스워드
  : 위에서 우리는 proftp라는 이름으로 데이타베이스를 생성했으므로, <DB명>에
    'proftp'를 적어준다. <호스트>는 일반적으로 'localhost'를 적어주나, 만약
    다른 서버에 생성하였다면 그 호스트 이름이나 IP를 적는다. <포트>는 기본이
    '3306'이나 포트를 변경하였다면 변경한 포트를 적는다.
    <아이디>는 MySQL에서 proftp 데이타베이스를 사용할 수 있는 사용자 계정 -
    시스템 사용자 계정이 아니다. 잘 모르겠으면 MySQL 문서 중 사용자 관리
    항목을 천천히 읽어본 후 아래를 진행하기 바란다 - 을 입력하고, <패스워드>
    에는... (말 안해도 다 알 것이다 ^^;;)
 
* SQLUserTable          users
  : 사용자 계정을 관리하는 테이블을 정의한다.
   
* SQLWhereClause        "valid = 1"
  : 사용자 계정에서 쿼리를 수행할 경우 추가적으로 덧붙일 구문을 적어준다.
    우리는 위에서 'valid'라는 필드를 가지고 있으며, 이 필드는 사용자 계정을
    임시적으로 막거나 해제하기 위해 사용한다고 기술한바 있다.
    여기서는 "valid = 1"이 덧붙여져서 쿼리가 실행되므로, valid 필드만
    0 이나 NULL 로 변경하면 이 계정 사용자는 더이상 로그인 할 수가 없다.
     
* SQLUsernameField      userid
  : 사용자 계정 필드
   
* SQLUidField           uid
  : 사용자 계정의 UID
 
* SQLGidField           gid
  : 사용자가 속한 그룹의 GID
   
* SQLPasswordField      passwd
  : 계정의 패스워드
   
* SQLHomedirField       homedir
  : 이 계정의 사용자를 위한 홈 디렉토리. 테이블에서는 시스템의 전체 경로로
    등록하여야 한다. (예: /var/ftp/pub)
     
* SQLShellField         shell
  : 이 계정의 사용자를 위한 쉘. 테이블에서 이 항목이 비어 있거나 사용할 수 없는
    쉘이 지정되어 있을 경우에는 로그인 되지 않는다. (예: /bin/sh)
     
* SQLLoginCountField    count
  : 사용자의 누적 로그인 카운트. 이 필드는 ProFTP에 의해서 자동으로 증가한다.
   
* SQLAuthTypes          Backend
  : 만약 password 필드에 패스워드를 넣기 위해 MySQL 내부 함수 중 PASSWORD()를
    사용하였다면 이와 같이 'Backend'로 지정하고, 일반 텍스트로 입력한 경우에는
    'Plaintext'로 지정한다.
     
* SQLDoAuth             on
  : SQL 로그인 관리를 할 것인지 말 것인지 지정한다. 이 항목을 off 시키면,
    SQLDoGroupAuth 나 SQLAuthoritative 등 다른 모든 항목을 무효화 시킨다.
 
* SQLDoGroupAuth        off
  : 그룹 관리를 할 것인지 말 것인지를 지정한다. 이 강좌에서는 그룹 관리를 하지
    않으며 이에 관한 것은 글을 읽는 사람의 몫으로 남겨둔다.
     
* SQLHomedir            /var/ftp
  : <homedir> 필드가 비어 있을 경우 기본으로 사용할 경로를 지정한다. 여기서는
    /var/ftp 로 되어 있으며, <homedir>가 정의되지 않은 사용자는 /var/ftp로
    로그인 된다.


 /usr/local/sbin/proftpd -d 5 -n -c /usr/local/etc/proftpd.conf
* 참고 url http://www.castaglia.org/proftpd/modules/mod_sql.html

추천 0 공유 · 더보기 목록

댓글 3

p poul 작성자 2010.06.22 15:08

실제 세팅된 proftpd

 

[root@       etc]# cat /etc/proftpd.conf
# This is the ProFTPD configuration file
# $Id: proftpd.conf,v 1.1 2004/02/26 17:54:30 thias Exp $

ServerName                      "CSE FTP server"
ServerIdent                     on "CSE FTP Server ready."
ServerAdmin                     root@localhost
ServerType                      standalone
#ServerType                     inetd
DefaultServer                   on
AccessGrantMsg                  "User %u logged in."
#DisplayConnect                 /etc/ftpissue
#DisplayLogin                   /etc/ftpmotd
#DisplayGoAway                  /etc/ftpgoaway
DeferWelcome                    off

# Cause every FTP user except adm to be chrooted into their home directory
# Aliasing /etc/security/pam_env.conf into the chroot allows pam_env to
# work at session-end time (http://bugzilla.redhat.com/477120)
# -0-----00-0--0-0-0-0-0--0-0-0-0-0-0-0-0
#  PJW
# -0-----00-0--0-0-0-0-0--0-0-0-0-0-0-0-0
# VRootEngine                     on
# VRootAlias                      etc/security/pam_env.conf /etc/security/pam_env.conf
# -0-----00-0--0-0-0-0-0--0-0-0-0-0-0-0-0
DefaultRoot                     ~ !adm

# Use pam to authenticate (default) and be authoritative
AuthPAMConfig                 proftpd
  # 주의 !!! : mysql과 연동하기 위해서는 아래의 AuthOrder를 꼭 주석으로 막아야 한다.
  # AuthOrder                   mod_auth_pam.c* mod_auth_unix.c

# Do not perform ident nor DNS lookups (hangs when the port is filtered)
IdentLookups                    off
UseReverseDNS                   off

# Port 21 is the standard FTP port.
Port                            21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# Default to show dot files in directory listings
ListOptions                     "-a"

# See Configuration.html for these (here are the default values)
#MultilineRFC2228               off
#RootLogin                      off
#LoginPasswordPrompt            on
#MaxLoginAttempts               3
#MaxClientsPerHost              none
#AllowForeignAddress            off     # For FXP

# Allow to resume not only the downloads but the uploads too
AllowRetrieveRestart            on
AllowStoreRestart               on

# 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                    20

# Set the user and group that the server normally runs at.
User                            nobody
Group                           nobody

# Disable sendfile by default since it breaks displaying the download speeds in
# ftptop and ftpwho
UseSendfile                     no

# This is where we want to put the pid file
ScoreboardFile                  /var/run/proftpd.score

# Dynamic Shared Object (DSO) loading
# See README.DSO and howto/DSO.html for more details
#
# General database support (http://www.proftpd.org/docs/contrib/mod_sql.html)
#   PJW
#   LoadModule mod_sql.c
   LoadModule mod_sql.c
#
# Mysql support (requires proftpd-mysql package)
# (http://www.proftpd.org/docs/contrib/mod_sql.html)
#   PJW
#   LoadModule mod_sql_mysql.c
   LoadModule mod_sql_mysql.c
#
# Postgresql support (requires proftpd-postgresql package)
# (http://www.proftpd.org/docs/contrib/mod_sql.html)
#   LoadModule mod_sql_postgres.c
#
# Quota support (http://www.proftpd.org/docs/contrib/mod_quotatab.html)
#   LoadModule mod_quotatab.c
#
# File-specific "driver" for storing quota table information in files
# (http://www.proftpd.org/docs/contrib/mod_quotatab_file.html)
#   LoadModule mod_quotatab_file.c
#
# SQL database "driver" for storing quota table information in SQL tables
# (http://www.proftpd.org/docs/contrib/mod_quotatab_sql.html)
#   LoadModule mod_quotatab_sql.c
#
# LDAP support (requires proftpd-ldap package)
# (http://www.proftpd.org/docs/directives/linked/config_ref_mod_ldap.html)
#   LoadModule mod_ldap.c
#
# LDAP quota support (requires proftpd-ldap package)
# (http://www.proftpd.org/docs/contrib/mod_quotatab_ldap.html)
#   LoadModule mod_quotatab_ldap.c
#
# Support for authenticating users using the RADIUS protocol
# (http://www.proftpd.org/docs/contrib/mod_radius.html)
#   LoadModule mod_radius.c
#
# Retrieve quota limit table information from a RADIUS server
# (http://www.proftpd.org/docs/contrib/mod_quotatab_radius.html)
#   LoadModule mod_quotatab_radius.c
#
# Administrative control actions for the ftpdctl program
# (http://www.proftpd.org/docs/contrib/mod_ctrls_admin.html)
#   LoadModule mod_ctrls_admin.c
#
# Execute external programs or scripts at various points in the process
# of handling FTP commands
# (http://www.castaglia.org/proftpd/modules/mod_exec.html)
#   LoadModule mod_exec.c
#
# Support for POSIX ACLs
# (http://www.proftpd.org/docs/modules/mod_facl.html)
#   LoadModule mod_facl.c
#
# Configure server availability based on system load
# (http://www.proftpd.org/docs/contrib/mod_load.html)
#   LoadModule mod_load.c
#
# Limit downloads to a multiple of upload volume (see README.ratio)
#   LoadModule mod_ratio.c
#
# Rewrite FTP commands sent by clients on-the-fly,
# using regular expression matching and substitution
# (http://www.proftpd.org/docs/contrib/mod_rewrite.html)
#   LoadModule mod_rewrite.c
#
# Support for miscellaneous SITE commands such as SITE MKDIR, SITE SYMLINK,
# and SITE UTIME (http://www.proftpd.org/docs/contrib/mod_site_misc.html)
#   LoadModule mod_site_misc.c
#
# Use the /etc/hosts.allow and /etc/hosts.deny files, or other allow/deny
# files, for IP-based access control
# (http://www.proftpd.org/docs/contrib/mod_wrap.html)
#   LoadModule mod_wrap.c
#
# Use the /etc/hosts.allow and /etc/hosts.deny files, or other allow/deny
# files, as well as SQL-based access rules, for IP-based access control
# (http://www.proftpd.org/docs/contrib/mod_wrap2.html)
#   LoadModule mod_wrap2.c
#
# Support module for mod_wrap2 that handles access rules stored in specially
# formatted files on disk
# (http://www.proftpd.org/docs/contrib/mod_wrap2_file.html)
#   LoadModule mod_wrap2_file.c
#
# Support module for mod_wrap2 that handles access rules stored in SQL
# database tables (http://www.proftpd.org/docs/contrib/mod_wrap2_sql.html)
#   LoadModule mod_wrap2_sql.c
#
# Provide a flexible way of specifying that certain configuration directives
# only apply to certain sessions, based on credentials such as connection
# class, user, or group membership
# (http://www.proftpd.org/docs/contrib/mod_ifsession.html)
#   LoadModule mod_ifsession.c

# TLS (http://www.castaglia.org/proftpd/modules/mod_tls.html)
<IfDefine TLS>
  TLSEngine                     on
  TLSRequired                   on
  TLSRSACertificateFile         /etc/pki/tls/certs/proftpd.pem
  TLSRSACertificateKeyFile      /etc/pki/tls/certs/proftpd.pem
  TLSCipherSuite                ALL:!ADH:!DES
  TLSOptions                    NoCertRequest
  TLSVerifyClient               off
  #TLSRenegotiate               ctrl 3600 data 512000 required off timeout 300
  TLSLog                        /var/log/proftpd/tls.log
</IfDefine>

# Dynamic ban lists (http://www.proftpd.org/docs/contrib/mod_ban.html)
# Enable this with PROFTPD_OPTIONS=-DDYNAMIC_BAN_LISTS in /etc/sysconfig/proftpd
<IfDefine DYNAMIC_BAN_LISTS>
  LoadModule                    mod_ban.c
  BanEngine                     on
  BanLog                        /var/log/proftpd/ban.log
  BanTable                      /var/run/proftpd/ban.tab

  # If the same client reaches the MaxLoginAttempts limit 2 times
  # within 10 minutes, automatically add a ban for that client that
  # will expire after one hour.
  BanOnEvent                    MaxLoginAttempts 2/00:10:00 01:00:00

  # Allow the FTP admin to manually add/remove bans
  BanControlsACLs               all allow user ftpadm
</IfDefine>


# Normally, we want users to do a few things.
<Global>
#  AllowOverwrite                yes
  AllowOverwrite                on
  <Limit ALL SITE_CHMOD>
    AllowAll
  </Limit>

  SQLConnectInfo           접속정보를 입력한다.

  SQLAuthTypes Backend
  SQLAuthenticate users groups
  SQLUserInfo users userid passwd uid gid homedir shell
# SQLDefaultGID                   2000
# SQLDefaultUID                   2000
# SQLMinUserGID                   500
# SQLMinUserUID                   500


  RequireValidShell off
  #PJW Appended 2003.12.5

SQLGroupInfo                    groups groupname gid members
SQLLog                          PASS updatecount
SQLNamedQuery                   updatecount UPDATE "count=count+1, reg_date=now() WHERE userid='%u'" users
SQLUserWhereClause              "valid = 1"
SQLDefaultHomeDir               /var/ftp


SQLNamedQuery count SELECT "count from users where userid='%u'"
#SQLShowInfo PASS "230" "%u님은 지금까지 %{count}번 접속하셨습니다."


SQLNamedQuery ftpname SELECT "name from users where userid='%u'"
SQLShowInfo PASS "230" "%{ftpname}님은 지금까지 %{count}번 접속하셨습니다."

SQLLog RETR receivefile
SQLNamedQuery receivefile INSERT "null, '%u', '%f', %b, now(), now()" file_download
# 사용자가 화일을 다운로드 할때 file_download 라는 테이블에 사용자명, 화일명, 화일사이즈, 날짜, 시간들을 INSERT 합니다.
# 위의 INSERT 문은 일반 SQL INSERT 문과 좀 다릅니다.

SQLLog STOR sendfile
SQLNamedQuery sendfile INSERT "null, '%u', '%f', %b, now(), now()" file_upload
# 위와 마찬가지로 이번에는 사용자가 화일을 업로드 할때 로그를 file_upload 테이블에 INSERT 합니다.


#------------------------------------------------------------------------------------------------
# PJW log를 이용하여 fail2ban에서 보안을 시키기 위해 로그를 변경하였음.
#------------------------------------------------------------------------------------------------
#SQLLogFile                      /var/log/ftpsql       //sql 관련 로그를 남깁니다.
SQLLogFile                      /var/log/proftpd/proftpd.log     //sql 관련 로그를 proftpd.log 파일에 남깁니다.
#------------------------------------------------------------------------------------------------
#SystemLog                       /var/log/ftplog
TransferLog                     /var/log/xferlog

#--------------------------------------------------------------------------------------------------------------------
#   다음과 같은 SQL 문으로 쉽게 사용자들의 데이터 전송량, 전송갯수, 전송된 화일명들을 알수 있습니다.
#  
#   SELECT user, sum(file_size)as transfer from file_upload group by user;
#   // 사용자별 업로드 사용량을 확인 하는 것입니다.
#  
#   SELECT user, count(file_name)as files, file_date from file_download group by user;
#   // 사용자별 다운로드 화일 갯수 확인
#  
#   ftp 사용자들이 많을 경우 사용하면 관리가 좀더 쉬워질것 같습니다.
#  
#   출처 : http://www.superuser.co.kr/home/eduboard/view.html?id=141&code=edu_community&start=0&position
#--------------------------------------------------------------------------------------------------------------------


#--------------------------------------------------------------------------------------------------------------------
#  PJW   송수신 파일 크기 제한. 2010-5-26
#
#  클라이언트에서 파일을 다운로드할 때(예를 들어 RETR 요청을 처리), RETR -  -  -   다운로드 요청.
#  서버는 요청받은 파일 크기의 제한이 설정되었는 지를 확인하고 설정된 제한값을 넘는 요청에 대해서는 전송을 중지한다.
#--------------------------------------------------------------------------------------------------------------------
#  MaxRetrieveFileSize 500 Mb
#--------------------------------------------------------------------------------------------------------------------
#  professor 그룹은 다운로드의 파일 크기를 500M로 제한하며  다른 사용자는 제한이 없다.
#--------------------------------------------------------------------------------------------------------------------
 MaxRetrieveFileSize 500 Mb  group  professor

#--------------------------------------------------------------------------------------------------------------------
#  professor 그룹은 업로드의 파일 크기를 300M로 제한하며  다른 사용자는 제한이 없다.
#--------------------------------------------------------------------------------------------------------------------
# MaxStoreFileSize 100 Mb user parkjw cehome milab
 MaxStoreFileSize 300 Mb group professor
# MaxStoreFileSize *
#--------------------------------------------------------------------------------------------------------------------

</Global>

# Define the log formats
LogFormat                       default "%h %l %u %t \"%r\" %s %b"
LogFormat                       auth    "%v [%P] %h %t \"%r\" %s"

# TLS
# Explained at http://www.castaglia.org/proftpd/modules/mod_tls.html
#TLSEngine                      on
#TLSRequired                    on
#TLSRSACertificateFile          /etc/pki/tls/certs/proftpd.pem
#TLSRSACertificateKeyFile       /etc/pki/tls/certs/proftpd.pem
#TLSCipherSuite                 ALL:!ADH:!DES
#TLSOptions                     NoCertRequest
#TLSVerifyClient                off
##TLSRenegotiate                ctrl 3600 data 512000 required off timeout 300
#TLSLog                         /var/log/proftpd/tls.log

# SQL authentication Dynamic Shared Object (DSO) loading
# See README.DSO and howto/DSO.html for more details.
#<IfModule mod_dso.c>
#   LoadModule mod_sql.c
#   LoadModule mod_sql_mysql.c
#   LoadModule mod_sql_postgres.c
#</IfModule>

# A basic anonymous configuration, with an upload directory.
#<Anonymous ~ftp>
#  User                         ftp
#  Group                                ftp
#  AccessGrantMsg               "Anonymous login ok, restrictions apply."
#
#  # We want clients to be able to login with "anonymous" as well as "ftp"
#  UserAlias                    anonymous ftp
#
#  # Limit the maximum number of anonymous logins
#  MaxClients                   10 "Sorry, max %m users -- try again later"
#
#  # Put the user into /pub right after login
#  #DefaultChdir                        /pub
#
#  # We want 'welcome.msg' displayed at login, '.message' displayed in
#  # each newly chdired directory and tell users to read README* files.
#  DisplayLogin                 /welcome.msg
#  DisplayFirstChdir            .message
#  DisplayReadme                        README*
#
#  # Some more cosmetic and not vital stuff
#  DirFakeUser                  on ftp
#  DirFakeGroup                 on ftp
#
#  # Limit WRITE everywhere in the anonymous chroot
#  <Limit WRITE SITE_CHMOD>
#    DenyAll
#  </Limit>
#
#  # An upload directory that allows storing files but not retrieving
#  # or creating directories.
#  <Directory uploads/*>
#    AllowOverwrite             no
#    <Limit READ>
#      DenyAll
#    </Limit>
#
#    <Limit STOR>
#      AllowAll
#    </Limit>
#  </Directory>
#
#  # Don't write anonymous accesses to the system wtmp file (good idea!)
#  WtmpLog                      off
#
#  # Logging for the anonymous transfers
#  ExtendedLog          /var/log/proftpd/access.log WRITE,READ default
#  ExtendedLog          /var/log/proftpd/auth.log AUTH auth
#
#</Anonymous>


p poul 작성자 2010.07.31 14:53


MaxClientsPerHost [최대 접속수] ["메세지"]

하나의 호스트당 접속할 수 있는 최대 접속수를 지정한다. 최대 접속수를 초과하면 "메시지"를 보여주고 접속을 허용하지 않는다.

MaxHostsPerUser [최대 접속수] ["메시지"]

계정 유저당 최대로 접속할 수 있는 호스트 수를 지정한다.

 

만약 한명의 유저가 하나의 ip에서 5개의 접속만 허용하도록 설정하기 위해서는 최대 접속수를 5로 설정하면 된다. 최대 접속수를 초과하면 "메시지"를 보여주고 접속을 허용하지 않는다.

TimeoutIdel  600

접속자가 아무 입력없이 휴식상태로 접속연결 상태를 유지할 수 있는 시간을 600초로 설정하는 옵션.

TimeoutNoTransfer  600

접속자가 로그인하여 접속한 이후부터 디렉토리 목록을 받고, 파일 업로드 하고 다운로드 할 때를 제외하고 아무 입력없이 접속을 유지할 수 있는 시간을 초 단위로 설정

TimeoutLogin  300

클라이언트가 접속 후 로그인 인증을 유지할 수 있는 시간을 설정한다. 200초가 지나면 다시 로그인 인증을 하여야 한다.

UpTime 10 service

proftp 서비스 시작 시간을 설정한다. 오전 10시부터 서비스를 시작하라는 옵션이다.

DonwTime 23 service

proftpd 서비스 종료시간을 설정한다. 위와 같이 UpTime를 10, DownTime을 23으로 설정 했다면 오전 10시부터 오후 11시까지 만 proftpd 서비스를 한다는 의미이다.

ShowSymlinks on | off

심볼릭 링크 파일들을 접속자들에게 보여줄 것인지 보여주지 않을 것인지 설정한다. 위의 옵션이 지정되지 않으면 기본설정이 off로 설정되어 심볼릭 링크파일을 보여주지 않는다. 만약 심볼릭 링크 보여주기 옵션을 활성화 한다면 다른 유저의 파일을 심볼릭 링크 시켜 볼 수 도 있다.

PassivePorts min-pasv-port max-pasv-port

예를 들어 패시브 포트를 PassivePorts 5000 6000 으로 설정했다면 액티브 모드의 데이터 전송 포트인 20번 포트를 5000-6000번 사이로 지정하는 것으로 해석하면 된다.

<Limit command | command-group[command2 ..]>

Limit 지시자에는 여러가지 명령어를 나열하여 명령어 사용권한을 제어 할 수 있다.

CWD : 디렉토리를 변경한다.

DELE : 파일을 삭제할 경우

MKD : 디렉토리를 만들 경우

RNFR, RNTO : 디렉토리의 이름을 바꿀 경우

RMD : 디렉토리 삭제

RETR : 서버에서 클라이언트로 파일 전송

STOR : 클라이언트에서 서버로 파일 전송

 

ALL : 모든 FTP 명령에 대한 제한을 적용

DIRS : LIST 와 NLST 와 같은 디렉토리 목록과 관련된 FTP 명령을 포함

READ : RETR, STAT 같은 파일 읽기와 관련된 FTP 명령을 포함, 디렉토리 목록은 포함 되지 않음

WRITE : MKD, RMD 같은 파일 또는 디렉토리 쓰기, 생성, 삭제와 관련된 FTP 명령을 포함.

 

LOGIN : 사용자가 서버에 login을 할 때 login 초기화의 허용 또는 제한에 사용하거나 의사 명령에 Limit을 적용해서 문맥에 연결한다.

AnonRequirePassword   on | off

익명 ftp 서비스에서 위의 지시자를 on 으로 설정하면 익명 접근시 패스워드를 필요로 한다. 즉 익명 유저 접속을 매칭시키는 ftp 계정의 패스워드를 알아야 접속이 가능하다.

RootLogin   off

시스템관리자 계정인 root로 ftp 접속을 하지 못하도록 설정하는 것이다. 기본 설정에는 포함되어 있지 않지만 설정을 추가해 주는 것이 좋다.

MaxStoreFileSize

파일 하나당 업로드 할 때 최대 업로드 용량을 3Mb 로 설정하는 옵션이다.

MaxRetrieveFileSize

다룬도르 할 때 파일 하나당 최대 다운로드 할 수 있는용량을 3Mb 로 설정하는 옵션이다 파일 사이즈가 3Mb를 초과하는 파일을 다운로드 할 때에는 다운로드 할 수 없게 된다.

TransferRate      RETR,STOR     1024000

업로드와 다운로드시 전송률을 Byte/Sec 단위로 설정할 수 있는 옵션이다.

초당 1Mb 전송 제한

ServerAdmin maybemaster@naver.com

서버 관리자 이메일을 설정하는 옵션이다.

DeferWelcom     on

접속자가 로그인을 정상적으로 마친 경우에만 서버이름 및 IP 주소 정보를 보여주도록 설정하는 옵션이다.

UserReverseDNS       off

IdentLookups            off

UseReverseDNS는 접속자의 IP번호를 사용하여 DNS lookup을 실행할 것인지 설정하는 옵션이다. 이 옵션을 on으로 하면 off로 설정하는 것 보다 접속속도가 느려 질 수 있어 일반적으로 off로 설정하여 사용하는 것이 좋다. IdentLookups는 Ident 프로토콜을 이용하여 접속 유저를 확인하는 옵션으로 필요한 옵션은 아니므로 off 로 사용하는 것 이 좋다. 기본값은 on 이다.

HideUser       root

HideGroup     root

어떤 유저와 그룹 소유의 파일들을 접속자에게 보여주지 않을 것인지 설정하는 옵션이다. 기본적으로 root유저와 root그룹 소유ㅈ의 파일들을 보여주지 않는 것이 좋을 것이다. 익명 ftp 서버 컨텍스트 사이에 설정하여 익명 유저들에게 보이지 않도록 한다.

관 관리자 2010.10.11 17:20

proftpd 1.3.2

위로