ProFTPD的配置文件proftpd.conf
创始人
2024-07-21 09:10:37
0

  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 下的五大问题

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...