hoge# pkg_add proftpd-1.2.8.tar.gz |
hoge# cd /usr/local/src hoge# tar zxvf proftpd-1.2.6rc2.tar.gz hoge# cd proftpd-1.2.6rc2 hoge# ./configure --prefix=/usr/local/proftpd hoge# make hoge# make install |
ftp auth required pam_unix.so try_first_pass ftp account required pam_unix.so try_first_pass ftp session required pam_permit.so |
# 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 "ホスト&サーバードメイン" ServerType standalone ServerAdmin "管理者のメールアドレス" 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 # Set the user and group that the server normally runs at. User nobody Group nogroup # Normally, we want files to be overwriteable. <Directory /*> AllowOverwrite on </Directory> DefaultRoot ~ !wheel |
ftp:*:1004:1004::0:0:anonymous ftp:/usr/home/ftp:/bin/sh |
ftp:*:1004: |
hoge# mkdir /usr/home/ftp hoge# chown ftp:ftp /usr/home/ftp hoge# chmod 755 /usr/home/ftp |
# 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 "ホストサーバードメイン" ServerType standalone ServerAdmin "管理者のメールアドレス" 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 # Set the user and group that the server normally runs at. User nobody Group nogroup # Normally, we want files to be overwriteable. <Directory /*> AllowOverwrite on </Directory> # 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 # 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> DefaultRoot ~ !wheel |
<Limit WRITE> DenyAll </Limit>
#<Anonymous ~ftp> </Anonymous ~ftp>の中に記述した場合(各ディレクトリーは予め作成しておく) # 書き込み専用ディレクトリ ~ftp/incomingの設定 <Directory incoming/*> AllowOverwrite on # 上書きを許可 <Limit READ DIRS> # ファイルの読出と、ディレクトリの一覧を DenyAll # どこからでも禁止する </Limit> <Limit WRITE> # 書き込みを AllowAll # どこからでも許可する </Limit> </Directory> # ファイル一覧ができない読み出し専用ディレクトリ ~ftp/outgoingの設定 <Directory outgoing/*> <Limit READ> # 読み出しを AllowAll # どこからでも許可する </Limit> <Limit WRITE DIRS> # ファイルの書込と、ディレクトリの一覧を DenyAll # どこからでも禁止する </Limit> </Directory> # pubディレクトリに対しては、いっさいFTPコマンドを受け付けない <Directory pub> <Limit ALL> DenyAll </Limit> </Directory6gt |
<Limit LOGIN> Order Allow, Deny AllowUser ftp Allow from 192.168.xxx. Deny from All </Limit> |
#!/bin/sh echo -n ' proftpd' /usr/local/proftpd/sbin/proftpd start > /dev/null |