2022-10-23 359
ProFTPD的配置文件proftpd.conf
在我们这个例子中,ProFTPD的配置文件在/opt/proftpd/etc目录中,就是proftpd.conf文件;您可以把它改名备份;
[root@localhost~]#cd/opt/proftpd/etc/ [root@localhostetc]#mvproftpd.confproftpd.confBAK
然后再新建一个 proftpd.conf 文件,内容如下;您可以对这个文件进行相应的调整;其中#号部份就是注掉的,不会生效;注意一下MySQL连接数据库部份;另外如果您不是把ProFTPD安装在了/opt/proftpd目录下,一些东西也是需要调整的;自己看着办吧;
#ThisisabasicProFTPDconfigurationfile(renameitto #'proftpd.conf'foractualuse.Itestablishesasingleserver #andasingleanonymouslogin.Itassumesthatyouhaveauser/group #"nobody"and"ftp"fornormaloperationandanon. ServerName"MyTestFTP"#这是您的FTP服务器的名字,自己写定 ServerTypestandalone ServerAdminxxxxx@xxxxxxxxxxx.com#这是管理员信箱,自己来写; DefaultServerOn #Displaymessage DisplayLogin/opt/proftpd/etc/ftplogin.msg #DisplayConnect/net/messages/ftp.pre #DisplayFirstChdirindex.txt #Port21isthestandardFTPport. Port21 #Limituserstologinbyusername AllowAll #Umask022isagoodstandardumasktopreventnewdirsandfiles #frombeinggroupandworldwritable. Umask022 #Limitloginattempts # MaxLoginAttempts5 #Setthemaximumnumberofsecondsadataconnectionisallowed #to"stall"beforebeingaborted. TimeoutStalled600 TimeoutLogin900 TimeoutIdle600 TimeoutNoTransfer600 #Settheuserandgroupunderwhichtheserverwillrun. Usernobody Groupnobody #TocauseeveryFTPusertobe"jailed"(chrooted)intotheirhome #directory,uncommentthisline. DefaultRoot~ #Usersneedsavalidshell # RequireValidShelloff #Performance:skipDNSresolutionwhenweprocessthelogs... UseReverseDNSoff #TurnoffIdentlookups IdentLookupsoff #Restartsessionsupport # AllowStoreRestarton AllowRetrieveRestarton #--------loadsql.modformysqlauthoritative--------# SQLConnectInfoproftpd@localhostproftpd123456 #注:上面这行是MySQL连接服务器部份,自己根据情况来改一改; SQLAuthTypesPlaintext SQLUserInfoftpusersuseridpasswduidgidhomedirshell SQLGroupInfoftpgroupsgroupnamegidmembers SQLAuthenticateusersgroups SQLNegativeCacheon SQLHomedirOnDemandon SQLLogFile/var/log/proftpd.sql.log SQLNamedQuerygetcountSELECT"countfromftpuserswhereuserid='%u'" SQLNamedQuerygetlastloginSELECT"lastloginfromftpuserswhereuserid='%u'" SQLNamedQueryupdatelogininfoUPDATE"countcount=count+1,host='%h',lastlogin=current_timestamp()WHEREuserid='%u'"ftpusers SQLShowInfoPASS"230""You'veloggedon%{getcount}times,lastloginat%{getlastlogin}" SQLLogPASSupdatelogininfo #--------loadsql.modformysqlauthoritative--------# #---------loadqudes.modforQuotalimit--------# QuotaDirectoryTallyon QuotaDisplayUnits"Mb" QuotaEngineon #QuotaLog/var/log/proftpd.quota.log QuotaShowQuotason SQLNamedQueryget-quota-limitSELECT"name,quota_type,per_session,limit_type,bytes_in_avail,\ bytes_out_avail,bytes_xfer_avail,files_in_avail,files_out_avail,files_xfer_availFROMquotalimits\ WHEREname='%{0}'ANDquota_type='%{1}'" SQLNamedQueryget-quota-tallySELECT"name,quota_type,bytes_in_used,bytes_out_used,\ bytes_xfer_used,files_in_used,files_out_used,files_xfer_usedFROMquotatallies\ WHEREname='%{0}'ANDquota_type='%{1}'" SQLNamedQueryupdate-quota-tallyUPDATE"bytes_in_usedbytes_in_used=bytes_in_used+%{0},\ bytes_out_usedbytes_out_used=bytes_out_used+%{1},bytes_xfer_usedbytes_xfer_used=bytes_xfer_used+%{2},\ files_in_usedfiles_in_used=files_in_used+%{3},files_out_usedfiles_out_used=files_out_used+%{4},\ files_xfer_usedfiles_xfer_used=files_xfer_used+%{5}\ WHEREname='%{6}'ANDquota_type='%{7}'"quotatallies SQLNamedQueryinsert-quota-tallyINSERT"%{0},%{1},%{2},%{3},%{4},%{5},%{6},%{7}"quotatallies QuotaLimitTablesql:/get-quota-limit QuotaTallyTablesql:/get-quota-tally/update-quota-tally/insert-quota-tally #---------loadqudes.modforQuotalimit--------# #Loggingoptions #DebugLevel #emerg,alert,crit(empfohlen),error,warn.notice,info,debug # SyslogLevelemerg SystemLog/var/log/proftpd.system.log TransferLog/var/log/proftpd.xferlog #Someloggingformats # LogFormatdefault"%h%l%u%t\"%r\"%s%b" LogFormatauth"%v[%P]%h%t\"%r\"%s" LogFormatwrite"%h%l%u%t\"%r\"%s%b" #Logfile/diraccess #ExtendedLog/var/log/proftpd.access_logWRITE,READwrite #Recordalllogins ExtendedLog/var/log/proftpd.auth_logAUTHauth #Paranoialogginglevel.... ExtendedLog/var/log/proftpd.paranoid_logALLdefault #注;上面几行是存放log的设置,不必改动也行;查看log就到上面相应的文件看吧; #TopreventDoSattacks,setthemaximumnumberofchildprocesses #to30.Ifyouneedtoallowmorethan30concurrentconnections #atonce,simplyincreasethisvalue.NotethatthisONLYworks #instandalonemode,ininetdmodeyoushoulduseaninetdserver #thatallowsyoutolimitmaximumnumberofprocessesperservice #(suchasxinetd). MaxInstances30#注最多30个ip同时登录使用ftp; #Maximumclientswithmessage #MaxClients2"Sorry,max%musers--tryagainlater" MaxClientsPerHost2"Sorry,only2sessionforonehost" #注每个ip,只能两个线程程,请自己调整; #Normally,wewantfilestobeoverwriteable. AllowOverwriteon RootLoginoff RequireValidShelloff #alphanumericcharactersforuploads(andnotshellcode...) #PathAllowFilter"^[a-zA-Z0-9_.-]()'+$" #PathAllowFilter"^[a-zA-Z0-9_.-]()'+$" #Wedon'twant.ftpaccessor.htaccessfilestobeuploaded #PathDenyFilter"(\.ftp)|(\.ht)[a-z]+$" #pathDenyFilter"\.ftp[a-z]+$" #Donotallowtopassprintf-Formats(security!seedocumentation!): #AllowFilter"^[a-zA-Z0-9@~/,_.-]*$" #DenyFilter"%"
原文链接:https://77isp.com/post/8781.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
小游客游戏攻略网游戏攻略网 2024年07月26日
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
扫码二维码
获取最新动态