./configure \
--prefix=/local/ProFTP \
--exec-prefix=/local/ProFTP \
--enable-shadow \
--enable-autoshadow \
--with-modules=mod_ratio:mod_readme:mod_wrap
make

make install

http://linux.vbird.idv.tw/linux_server/0410proftpd.php
nano /local/ProFTP/etc/proftpd.conf

伺服器的名稱和啟動模式
ServerName "ProFTP"
ServerType standalone

DefaultServer on
PersistentPasswd on
ServerAdmin neo@msa.hinet.net

伺服器啟動的服務帳號和群組
User nobody
Group nogroup

連接埠
Port 21

IPv6 支援
UseIPv6 off

關閉 Ident 和使用者網域反查
IdentLookups off
UseReverseDNS off


使用本地時間
SetEnv TZ :/etc/localtime
TimesGMT off

設定支援下載續傳、上傳續傳、支援 FXP
AllowStoreRestart on
AllowRetrieveRestart on
AllowForeignAddress on


預設檔案複寫設定
AllowOverwrite on

顯示站台歡迎訊息
DeferWelcome on

設定使用者登入和登出會看到的訊息檔
DisplayLogin /etc/proftpd/welcome.msg
DisplayQuit /etc/proftpd/logout.msg


指定站台系統 Log 位置
SystemLog /RAID/Log/ProFTP/proftpd.log

定義 Log 格式,紀錄登入 (login.log) 和傳檔 (transfer.log) 的細節
TransferLog /RAID/Log/ProFTP/xferlog
LogFormat myxfer "%{%Y-%m-%d %H:%M:%S}t [%u] \"%m %f\" (%bB/%TS)"
LogFormat myauth "%{%Y-%m-%d %H:%M:%S}t [%u] \"%r\": %S (%a)"
ExtendedLog /RAID/Log/ProFTP/login.log auth myauth
ExtendedLog /RAID/Log/ProFTP/transfer.log read,write myxfer


最大連線數
MaxInstances 30

預設踢掉斷線時間,當沒有傳檔、連線停頓 60 秒或動作閒置 3 分鐘就斷線
TimeoutNoTransfer 60
TimeoutStalled 60
TimeoutIdle 180


同主機只允許 2 個登入、同帳號只允許 3 個登入、最多只允許 5 個連線,以及其失敗的訊息
MaxClientsPerHost 2 "一台主機最多只允許 2 個登入!" 
MaxHostsPerUser 3 "一個帳號最多允許 3 個登入!" 
MaxClients 5 "連線數超過上限!"

設定使用者群組 (ftp) 的下載頻寬 (200K)
TransferRate RETR 200 group ftp

預設上傳目錄和檔案的讀寫權限,預設是 022,改成 002 表示屬同群組的帳號都可以更改
Umask 002

允許 root 登入
RootLogin on

允許被設定成不得由遠端登入的帳號 (invalid shell) 能 FTP 進來
RequireValidShell off

只要不屬於 ftp 群組的人,可以離開自己的預設根目錄
# DefaultRoot ~ ftp

預設關閉所有 SITE 命令以策安全
<Limit SITE_CHMOD>
  DenyAll
</Limit>

????????
<Directory incoming>
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
<Limit READ WRITE>
DenyAll
</Limit>
<Limit STOR>
AllowAll
</Limit>
</Directory>


歡迎訊息(會顯示登入位址、伺服器時間、硬碟可用空間、目前路徑和連線數量)
nano /etc/proftpd/welcome.msg
Welcome %U from %R to %L site !
Current Time: %T
Available Capacity: %F KB
Current Directory: %C
Current/Max Allow Connection: %N/%M

登出的訊息檔(會顯示連線完,總共上傳和下載的檔案和容量)
nano /etc/proftpd/logout.msg
Upload: %{total_bytes_in} bytes, %i files
Download: %{total_bytes_out} bytes, %o files
Bye Bye, %U from %R !


/local/ProFTP/sbin/proftpd &

arrow
arrow
    文章標籤
    Linux Gentoo ProFTP proftpd
    全站熱搜

    NeoKing 發表在 痞客邦 留言(0) 人氣()