最終更新日 2003/11/19  戻る  493738 人 REMOTE = 38.103.63.59 REFERER =

★ProFTP : proftpd

ftpにlog inする人のグループはhomeuser(家族しか使わない)にしました.

「/etc/group」にユーザ登録
# groupadd -g 1000 homeuser
(-g gid)
# useradd -c 'User Comment' -g homeuser user-name
# passwd user-name

以下の設定で運用しています.DefaultRoot ~/をコメントアウトすれば全てのファイルを見る事が出来てしまいます.
proftpd.confを変更した時は #/etc/rc.d/init.d/proftpd restart.
自動起動したい人はntsysvもしくはchkconfigで設定する.
スタンドアローンで起動しているためinetdはいじらなくても動いています.
http://www.mm-labo.com/computer/linux/proftpd.htmlを読むとinetdからの起動方法が書いてあります.

/etc/proftpd.conf

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

ServerName "ProFTPD Basic Configuration"
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

# Use localtime
TimesGMT FALSE

# See Configuration.html for these (here are the default values)
# ルートログオンは認めない 認証失敗は3回まで
RootLogin off
MaxLoginAttempts 3

# Syslogファシリティとして LOCAL6を使用する (→syslogの設定)
SyslogFacility LOCAL6

# ファイル転送ログを指定する (デフォールトは/var/log/xferlog)
# 不要な場合は'NONE'を指定する
TransferLog /var/log/xferlog

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

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

# ホームディレクトリ以外は見れない設定 コメントアウトすると全てをさらけだします
Defaultroot ~/

# ログオンできるのはhomeuserのみ 読み書きできるものとする
# Normally, we want files to be overwriteable.
<Directory /*>
AllowOverwrite on
</Directory>
<Limit LOGIN>
DenyAll
AllowGroup homeuser
</Limit>

# anonymousログオンは認めないので以下を全部コメントアウト
# A basic anonymous configuration, no upload directories.
##<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

## # do not require shells listed in /etc/shells (user ftp do not have shell...)
## RequireValidShell no

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

/etc/syslog.conf に以下の設定を追加する.

# Save proftp messages also to proftp.log
local6.* /var/log/proftp.log

# service syslog restart

これでproftpに接続してきたlogは/var/log/proftp.logに記録される.
ファイルの転送などは/var/log/xfer.logに記録される.
これまでの設定ではホームディレクトリのみが見れるようになっています.上の方を見るためにはどうしたらいいでしょうか?そこでmasterグループを作っておき,以下のようにします.
Defaultroot ~/httpdocs homeuser,!master
<Directory /*>
AllowOverwrite on
</Directory>
<Limit LOGIN>
DenyAll
AllowGroup homeuser
AllowGroup master
</Limit>
homeuserは家族用のグループ.こいつは/home/user/httpdocs
しかのぞけない.もう一つのmasterグループは上のほうまでのぞけます.


Copyright 2002-2003 Kai All Rights Reserved & This site is Link Free 戻る