○ proftpd.confの設定

*proftpd-1.3.3aで使っています
*完全コピーしないこと (エラーが出ることあり)

*RequireValidShell on (default) になっています
*ログインユーザは 有効なshell (/etc/shellsに記載) を持つこと
*SSL/TLS接続で安全なFTPサイトになるとは限らないので注意します
*行頭の数字は説明のための番号です、実際には入れないでください
*"#" で始まる行はコメントとして解釈されます
紫色文字 追加変更した部分です

○proftpd.confの修正

: /etc/proftpd.conf

 
 
 
 
 

001 
002
003
004

 
005
006
007
008

009
010
011

012

013
014
015

 
016
017

 
018

 
 
019

 
020
021

 
 
 
 
 
 
022

 
023
024
025

 
026
027

 
 
028

029
030
031
032
033

 
034

 
035
036
037
038
039

 
040
041
042
043
044
045
046
047
048
049
050

 
051
052

053
054

 
055
056

 
057
058
059

 
 
060
061

 
062
063
064

065
066
067

068
069
070

 
071
072
073
# This is a basic ProFTPD configuration file
#
# 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.

ServerIdent on  "Welcome ko-jiya528 server"
ServerName    "ProFTPD Default Installation"
ServerType    standalone
DefaultServer on

# Shared Object (DSO) loading
<IfModule mod_dso.c>
    LoadModule mod_ident.c
    LoadModule mod_unique_id.c
</IfModule>

IdentLookups    off
UniqueIDEngine  on
#ListOptions    "-a"

TCPAccessFiles  /etc/hosts.allow /etc/hosts.deny

AuthUserFile    /etc/ftpd.passwd
AuthGroupFile   /etc/ftpd.group
AuthOrder mod_auth_file.c mod_auth_unix.c

# Port 21 is the standard FTP port.
Port           21
PassivePorts   50000 50030

# Don't use IPv6 support by default.
UseIPv6        off

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

# Use localtime
TimesGMT off
SetEnv TZ JST-9

# 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

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

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

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

<Limit LOGIN>
    Order deny,allow
    Deny from 192.168.0.21
    Allow from 192.168.0.0/24
</Limit>

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

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
    Order deny,allow
    Deny from 192.168.0.21
    Allow from 192.168.0.0/24
</Limit>

# mod_tls configuration.
<IfModule mod_tls.c>
    TLSEngine       on
    TLSLog          /var/log/proftpd/tls.log
    TLSProtocol     SSLv3 TLSv1
    TLSRequired     off
    TLSRSACertificateFile    /etc/pki/tls/certs/www-server.crt
    TLSRSACertificateKeyFile /etc/pki/tls/private/www-server.key
    TLSOptions      NoCertRequest NoSessionReuseRequired
    TLSVerifyClient off
    TLSRenegotiate none
</IfModule>

# A basic anonymous configuration, no upload directories.
<Anonymous /home/ftp>
    TransferRate RETR 10

    User    ftp
    Group   ftp

# We want clients to be able to login with "anonymous" as well as "ftp"
    UserAlias  anonymous ftp
    RequireValidShell off

# Limit the maximum number of anonymous logins
    MaxClients        10
    MaxClientsPerHost 1
    MaxHostsPerUser   1

# We want 'welcome.msg' displayed at login, and '.message'
# displayed in each newly chdired directory.
    DisplayLogin     welcome.msg
    DisplayChdir     .message

# Limit WRITE everywhere in the anonymous chroot
    <Limit WRITE>
      DenyAll
    </Limit>

    <Limit LOGIN>
        AllowAll
    </Limit>

    <Limit SITE_CHMOD>
        DenyAll
    </Limit>

    # Logging for the anonymous transfers
    ExtendedLog    /var/log/proftpd/access.log WRITE,READ default
    ExtendedLog    /var/log/proftpd/auth.log AUTH auth
</Anonymous>

○簡単な説明

001 サーバにアクセスしたときに表示される名前

ServerIdent on の後に表示したいコメントを追加します
003 /etc/rc.d/init.d/proftpdスクリプトで起動します
005-008  dsoでsharedモデュールを組み込む
009 identdの名前解決を無視
010 FTPセッションごとにuniqueなIDをふる(デフォルト ON)
011 FFFTPなどの -a オプションで.(ドット)ファイルを表示
012 /etc/hosts.allow,hosts.denyによるアドレス制御

1.3.3ではコンソールにログを出す(bug?)のでログの出力を変更します
013-015 ftp専用パスワードによる認証と、unixパスワードによる認証の設定
013 ftp専用ユーザファイル
014 ftp専用グループファイル
015 ログイン認証の優先順
017 passive接続で使うport範囲を設定します
018 IPv6を使わない
020-021 時間設定をlocal(日本時間)にします
023-024 ログフォーマットを定義します
025 システムログを専用のログファイルに出力します
027 Groupをnobodyに変更します
028 chrootの設定 wheelグループ以外homeディレクトリを抜けられません
029-033 ログイン制限です Localネットワークのみ許可

denyを最初にチェックし、該当する場合はallowをチェックしません

denyに該当しない場合、allowがチェックされます
035-039 アクセス権の変更制限です Localネットワークのみ許可

denyを最初にチェックし、該当する場合はallowをチェックしません

denyに該当しない場合、allowがチェックされます
040-050 SSL/TLSで接続するための設定です
静的にmod_tlsを組み込んでいるのでLoadModuleの設定はしていません
041 SSL/TLS protocol engineの使用許可
042 mod_tlsのログを取ります、ログを書き出すファイルを指定します
043 SSL/TLS プロトコルのバージョンを指定します
044 SSL/TLSを強制しない、通常のFTP接続も許可されます
045-046 証明書と秘密鍵を指定します(作成は省略)
047 NoCertRequest 証明書の警告をださない
NoSessionReuseRequired SSLセッションの再利用を許可しない
048 クライアント証明書を使用しない
049 1つのファイルをデータ転送中にりネゴシエーションを行なはない
051-073 Anonymous接続の設定です
051 Anonymous接続のディレクトリを/home/ftpに設定
052 速度制限をしています ダウン 10Kbite/s
056 ユーザーのログインシェルをチェックしない
058 マルチクライアントの制限
059 マルチホストの制限
065-067 029-033のログイン制限の緩和 全てのアドレスからの接続を許可
068-070 035-039のアクセス権の変更制限の強化 全てのアドレスからの変更を禁止
071-072 Anonymous接続専用のログを取ります

○ Copyright(c) 528p.com All Rights Reserved.