ProFTPD的配置文件proftpd.conf

运维 系统运维
ProFTPD是一个Unix平台、或者Unix类(如Linux, FreeBSD等) 下的FTP服务器程序,是自由软件基金会版权声明 发布一项的免费软件,可以说任何只要遵守 自由软件基金会版权声明,就可以自己修改源始代码。本文主要是ProFTPD的配置文件proftpd.conf 的讲解。

  ProFTPD的配置文件proftpd.conf

  在我们这个例子中,ProFTPD的配置文件在/opt/proftpd/etc目录中,就是proftpd.conf文件;您可以把它改名备份;

  1.   [root@localhost ~]# cd /opt/proftpd/etc/  
  2.  
  3.   [root@localhost etc]# mv proftpd.conf proftpd.confBAK  
  4.  

  然后再新建一个 proftpd.conf 文件,内容如下;您可以对这个文件进行相应的调整;其中#号部份就是注掉的,不会生效;注意一下MySQL连接数据库部份;另外如果您不是把ProFTPD安装在了/opt/proftpd目录下,一些东西也是需要调整的;自己看着办吧;

  1.   # This is a basic ProFTPD configuration file (rename it to  
  2.  
  3.   # 'proftpd.conf' for actual use. It establishes a single server  
  4.  
  5.   # and a single anonymous login. It assumes that you have a user/group  
  6.  
  7.   # "nobody" and "ftp" for normal operation and anon.  
  8.  
  9.   ServerName "My TestFTP" #这是您的FTP服务器的名字,自己写定  
  10.  
  11.   ServerType standalone  
  12.  
  13.   ServerAdmin xxxxx@xxxxxxxxxxx.com #这是管理员信箱,自己来写;  
  14.  
  15.   DefaultServer On  
  16.  
  17.   # Display message  
  18.  
  19.   DisplayLogin /opt/proftpd/etc/ftplogin.msg  
  20.  
  21.   #DisplayConnect /net/messages/ftp.pre  
  22.  
  23.   #DisplayFirstChdir index.txt  
  24.  
  25.   # Port 21 is the standard FTP port.  
  26.  
  27.   Port 21  
  28.  
  29.   # Limit users to login by username  
  30.  
  31.     
  32.  
  33.   AllowAll  
  34.  
  35.     
  36.  
  37.   # Umask 022 is a good standard umask to prevent new dirs and files  
  38.  
  39.   # from being group and world writable.  
  40.  
  41.   Umask 022  
  42.  
  43.   # Limit login attempts  
  44.  
  45.   #  
  46.  
  47.   MaxLoginAttempts 5  
  48.  
  49.   # Set the maximum number of seconds a data connection is allowed  
  50.  
  51.   # to "stall" before being aborted.  
  52.  
  53.   TimeoutStalled 600  
  54.  
  55.   TimeoutLogin 900  
  56.  
  57.   TimeoutIdle 600  
  58.  
  59.   TimeoutNoTransfer 600  
  60.  
  61.   # Set the user and group under which the server will run.  
  62.  
  63.   User nobody  
  64.  
  65.   Group nobody  
  66.  
  67.   # To cause every FTP user to be "jailed" (chrooted) into their home  
  68.  
  69.   # directory, uncomment this line.  
  70.  
  71.   DefaultRoot ~  
  72.  
  73.   # Users needs a valid shell  
  74.  
  75.   #  
  76.  
  77.   RequireValidShell off  
  78.  
  79.   # Performance: skip DNS resolution when we process the logs...  
  80.  
  81.   UseReverseDNS off  
  82.  
  83.   # Turn off Ident lookups  
  84.  
  85.   IdentLookups off  
  86.  
  87.   # Restart session support  
  88.  
  89.   #  
  90.  
  91.   AllowStoreRestart on  
  92.  
  93.   AllowRetrieveRestart on  
  94.  
  95.   #-------- load sql.mod for mysql authoritative --------#  
  96.  
  97.   SQLConnectInfo proftpd@localhost proftpd 123456  
  98.  
  99.   #注:上面这行是MySQL连接服务器部份,自己根据情况来改一改;  
  100.  
  101.   SQLAuthTypes Plaintext  
  102.  
  103.   SQLUserInfo ftpusers userid passwd uid gid homedir shell  
  104.  
  105.   SQLGroupInfo ftpgroups groupname gid members  
  106.  
  107.   SQLAuthenticate users groups  
  108.  
  109.   SQLNegativeCache on  
  110.  
  111.   SQLHomedirOnDemand on  
  112.  
  113.   SQLLogFile /var/log/proftpd.sql.log  
  114.  
  115.   SQLNamedQuery getcount SELECT "count from ftpusers where userid='%u'"  
  116.  
  117.   SQLNamedQuery getlastlogin SELECT "lastlogin from ftpusers where userid='%u'"  
  118.  
  119.   SQLNamedQuery updatelogininfo UPDATE "countcount=count+1,host='%h',lastlogin=current_timestamp() WHERE userid='%u'" ftpusers  
  120.  
  121.   SQLShowInfo PASS "230" "You've logged on %{getcount} times, last login at %{getlastlogin}"  
  122.  
  123.   SQLLog PASS updatelogininfo  
  124.  
  125.   #-------- load sql.mod for mysql authoritative --------#  
  126.  
  127.   #--------- load qudes.mod for Quota limit --------#  
  128.  
  129.   QuotaDirectoryTally on  
  130.  
  131.   QuotaDisplayUnits "Mb"  
  132.  
  133.   QuotaEngine on  
  134.  
  135.   #QuotaLog /var/log/proftpd.quota.log  
  136.  
  137.   QuotaShowQuotas on  
  138.  
  139.   SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, \  
  140.  
  141.   bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM quotalimits \  
  142.  
  143.   WHERE name = '%{0}' AND quota_type = '%{1}'"  
  144.  
  145.   SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, \  
  146.  
  147.   bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM quotatallies \  
  148.  
  149.   WHERE name = '%{0}' AND quota_type = '%{1}'"  
  150.  
  151.   SQLNamedQuery update-quota-tally UPDATE "bytes_in_usedbytes_in_used = bytes_in_used + %{0}, \  
  152.  
  153.   bytes_out_usedbytes_out_used = bytes_out_used + %{1}, bytes_xfer_usedbytes_xfer_used = bytes_xfer_used + %{2}, \  
  154.  
  155.   files_in_usedfiles_in_used = files_in_used + %{3}, files_out_usedfiles_out_used = files_out_used + %{4}, \  
  156.  
  157.   files_xfer_usedfiles_xfer_used = files_xfer_used + %{5} \  
  158.  
  159.   WHERE name = '%{6}' AND quota_type = '%{7}'" quotatallies  
  160.  
  161.   SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies  
  162.  
  163.   QuotaLimitTable sql:/get-quota-limit  
  164.  
  165.   QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally  
  166.  
  167.   #--------- load qudes.mod for Quota limit --------#  
  168.  
  169.   # Logging options  
  170.  
  171.   # Debug Level  
  172.  
  173.   # emerg, alert, crit (empfohlen), error, warn. notice, info, debug  
  174.  
  175.   #  
  176.  
  177.   SyslogLevel emerg  
  178.  
  179.   SystemLog /var/log/proftpd.system.log  
  180.  
  181.   TransferLog /var/log/proftpd.xferlog  
  182.  
  183.   # Some logging formats  
  184.  
  185.   #  
  186.  
  187.   LogFormat default "%h %l %u %t \"%r\" %s %b"  
  188.  
  189.   LogFormat auth "%v [%P] %h %t \"%r\" %s"  
  190.  
  191.   LogFormat write "%h %l %u %t \"%r\" %s %b"  
  192.  
  193.   # Log file/dir access  
  194.  
  195.   # ExtendedLog /var/log/proftpd.access_log WRITE,READ write  
  196.  
  197.   # Record all logins  
  198.  
  199.   ExtendedLog /var/log/proftpd.auth_log AUTH auth  
  200.  
  201.   # Paranoia logging level....  
  202.  
  203.   ExtendedLog /var/log/proftpd.paranoid_log ALL default  
  204.  
  205.   #注;上面几行是存放log的设置,不必改动也行;查看log就到上面相应的文件看吧;  
  206.  
  207.   # To prevent DoS attacks, set the maximum number of child processes  
  208.  
  209.   # to 30. If you need to allow more than 30 concurrent connections  
  210.  
  211.   # at once, simply increase this value. Note that this ONLY works  
  212.  
  213.   # in standalone mode, in inetd mode you should use an inetd server  
  214.  
  215.   # that allows you to limit maximum number of processes per service  
  216.  
  217.   # (such as xinetd).  
  218.  
  219.   MaxInstances 30 #注最多30个ip同时登录使用ftp;  
  220.  
  221.   # Maximum clients with message  
  222.  
  223.   #MaxClients 2 "Sorry, max %m users -- try again later"  
  224.  
  225.   MaxClientsPerHost 2 "Sorry, only 2 session for one host"  
  226.  
  227.   #注每个ip,只能两个线程程,请自己调整;  
  228.  
  229.   # Normally, we want files to be overwriteable.  
  230.  
  231.     
  232.  
  233.   AllowOverwrite on  
  234.  
  235.     
  236.  
  237.   RootLogin off  
  238.  
  239.   RequireValidShell off  
  240.  
  241.   # alphanumeric characters for uploads (and not shell code...)  
  242.  
  243.   #PathAllowFilter "^[a-zA-Z0-9_.-]()'+$"  
  244.  
  245.   #PathAllowFilter "^[a-zA-Z0-9 _.-]()'+$"  
  246.  
  247.   # We don't want .ftpaccess or .htaccess files to be uploaded  
  248.  
  249.   #PathDenyFilter "(\.ftp)|(\.ht)[a-z]+$"  
  250.  
  251.   #pathDenyFilter "\.ftp[a-z]+$"  
  252.  
  253.   # Do not allow to pass printf-Formats (security! see documentation!):  
  254.  
  255.   #AllowFilter "^[a-zA-Z0-9@~ /,_.-]*$"  
  256.  
  257.   #DenyFilter "%"  

 

【编辑推荐】

  1. ProFTPD的MySQL数据库
  2. ProFTPD 有问必答
  3. Linux ProFTPd服务器配置(全)
  4. ProFTPD的配置
  5. 如何安装ProFTPD
  6. ProFTPD 下的五大问题
责任编辑:zhaolei 来源: 网络转载
相关推荐

2011-02-24 13:42:34

2011-02-22 17:24:32

2011-02-24 14:34:57

2011-02-25 09:16:48

Proftpd

2011-03-08 10:38:13

proftpd.con

2011-03-02 17:59:13

Proftpd.con设定

2011-03-08 10:28:40

Proftpd

2011-03-08 10:54:25

proftpd.con

2011-02-25 16:39:34

proftpd配置文件

2011-03-08 10:45:36

proftpd.con

2011-03-03 13:16:32

Proftpd配置文件

2011-02-25 13:34:33

Proftpd结构

2011-03-03 13:00:21

2011-02-22 10:08:46

ProFTPD配置

2011-02-24 13:15:59

2011-02-23 11:15:21

DebianProFTPd

2011-02-23 10:43:17

2011-02-24 14:47:48

ProFTPD

2011-02-25 12:30:01

ProFtpd配置

2011-03-08 17:04:10

ProFTPDUbuntu
点赞
收藏

51CTO技术栈公众号