討論區主頁 FTP 檔案伺服器
我的 ProFTPD 設定還是行不通! | 無發表權 |
| 樹狀顯示 | 新的在前 | 前一個主題 | 下一個主題 | 頁尾 |
| 發表者 | 討論內容 |
|---|---|
| JKK | 發表時間: 2004-03-01 20:07 |
Not too shy to talk ![]() ![]() 註冊日: 2004-03-01 來自: 發表數: 37 |
我的 ProFTPD 設定還是行不通! 大家好,我發現我對ftp限定只能由主機的權限來管控,
proftpd.conf設定似乎完全無用(目前我是這樣認為) 我看過鳥哥的與本站proftpd.conf都沒有我要隱藏.*檔的訊息, 況且像鳥哥網站對proftpd.conf寫得這詳盡,但是我把套用來卻完全無用,目前我的ftp的權限都是用chmod XXX 來管控,否則靠proftpd.conf沒辦法。 沒辦法,我不想搞了,如何隱藏.*檔 proftpd.conf如下(就拿這個來step by step教學吧): # # To have more informations about Proftpd configuration # look at : http://www.proftpd.org/ # # 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 "ftp.lab.mlc.edu.tw" ServerAdmin "tim@dnes.mlc.edu.tw" ServerType standalone # ServerType inetd 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 under which the server will run. User nobody Group nogroup TimesGMT off # To cause every FTP user to be "jailed" (chrooted) into their home # directory, uncomment this line. DefaultRoot ~ !tch # LogFormat awstats "%a %t \"%m %F\" %s %b %A" # ExtendedLog /var/log/proftpd.log read,write awstats # LogFormat awstats "%t %h %u %m %f %s %b" LogFormat awstats "%t %h %u %m %J %s %b" ExtendedLog /var/log/proftpd.log read,write awstats TransferLog none ScoreboardFile /var/run/proftpd.scoreboard ListOptions "+a" # Normally, we want files to be overwriteable. <Directory /> AllowOverwrite on </Directory> # A basic anonymous configuration, no upload directories. If you do not # want anonymous users, simply delete this entire <Anonymous> section. ######################################################################### # # # Uncomment lines with only one # to allow basic anonymous access # # # ######################################################################### <Anonymous ~ftp> # <Limit LOGIN> # Order allow,deny # Order deny,allow # Deny from all # Allow from 163.19.0.0/16 61.221.95.40/29 # Deny from all # </Limit> User ftp Group ftp RequireValidShell off AnonRequirePassword off # TransferRate STOR 100 user anonymous,ftp # TransferRate RETR 50 user anonymous,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 30 "匿名登入者連線數已經飽和了!" MaxClientsPerHost 2 ### 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> # <Directory ISO-IMAGES> # <Limit READ DIRS RETR> # Order Allow,Deny # Allow .mlc.edu.tw # Allow .bsdlab.idv.tw # Deny All # </Limit> # </Directory> </Anonymous> |
| tim | 發表時間: 2004-03-01 22:47 |
網站管理員 ![]() ![]() 註冊日: 2003-12-28 來自: Miaoli 發表數: 561 |
Re: ftp設定還是行不通!
|
| JKK | 發表時間: 2004-03-02 00:06 |
Not too shy to talk ![]() ![]() 註冊日: 2004-03-01 來自: 發表數: 37 |
Re: ftp設定還是行不通! 恐怕仍然行不通喔!
原文篩選如下: ListOptions ListOptions [ "options string"] [ ["strict"]] Default None Context server config, <VirtualHost>, <Anonymous>, <Global>, <Directory>, .ftpaccess Description Normally, FTP commands involving directory listings (NLST, LIST and STAT) use the arguments (options) passed by the client to determine what files are displayed and the format they are displayed in. The ListOptions directive can alter the behaviour of such listings by making it such that a certain option (or options) is always in effect, or is always disabled. In addition to the normal dash-prefixed options that the builtin ls takes, the directive allows for plus-prefixed options. The plus-prefixed options allow for their dash-prefixed equivalents, potentially given by a user, to be disabled, while still allowing other options to function normally. In the optional "strict" keyword is used, then the configured options will override any options given by the user (i.e. the user's options will be ignored). See also Exampl # Force directory listings to always show dotfiles ListOptions "-a" # To prevent anyone from doing recursive listings, but still allowing # other user options, use +R to disable any -R option given by users ListOptions "+R" # To allow only the basic listing, no options, always ListOptions "" strict 這篇引文我之前看了一遍,現在再仔細推敲它的意思,對照你的設定,更加了解dash-prefixed(-號)與plus-prefixed(+號) 的差別,再套用在我的設定,仍然沒用,我的設定如下: # # To have more informations about Proftpd configuration # look at : http://www.proftpd.org/ # # 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 "ds55.dss.mlc.edu.tw" ServerType inetd 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 under which the server will run. User nobody Group nogroup RequireValidShell off # To cause every FTP user to be "jailed" (chrooted) into their home # directory, uncomment this line. #DefaultRoot ~ ListOptions "" # Normally, we want files to be overwriteable. <Directory /*> AllowOverwrite on </Directory> # A basic anonymous configuration, no upload directories. If you do not # want anonymous users, simply delete this entire <Anonymous> section. ######################################################################### # # # Uncomment lines with only one # to allow basic anonymous access # # # ######################################################################### <Anonymous /home/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 ListOptions "+a" ### Limit WRITE everywhere in the anonymous chroot <Limit WRITE> DenyAll </Limit> <Directory /uploads/*> <Limit READ> DenyAll </Limit> <Limit STOR> AllowAll </Limit> </Directory> RequireValidShell off AnonRequirePassword off </Anonymous> <Global> </Global> ds55# kill -HUP `cat /var/run/inetd.pid` 這是三次試驗的結果,先在主機環境設ListOptions "+a",沒用,再改成ListOptions "",沒用,再在anonymous加上ListOptions "+a", 沒用,我每次可都有kill -HUP `cat /var/run/inetd.pid`喔! 撇開這不談,最基本的在<Anonymous> <Limit WRITE> DenyAll </Limit>就無法發揮作用 鳥哥說這以下設定只能上傳沒法下載 <Directory /uploads/*> <Limit READ> DenyAll </Limit> <Limit STOR> AllowAll </Limit> </Directory> 沒用,就是沒用。 我只能在主機利用chmod xxx才能達到部分效果。 我現在懷疑問題跟conf無關,我一直在這裡打轉,只是徒勞, 我相信proftp根本沒複雜到足以讓我繞那麼久還沒找到出路, 如果簡單的功能都能設計成這麼惱人,那將是它的缺陷,不用也吧。 我想我該來個重新按裝proftp呢?或kernel升級,再說吧! |
| tim | 發表時間: 2004-03-02 06:57 |
網站管理員 ![]() ![]() 註冊日: 2003-12-28 來自: Miaoli 發表數: 561 |
Re: ftp設定還是行不通! 網站上的設定資料,請參考就好,不要把它當作是聖經。
今天在 ftp://ftp.lab.mlc.edu.tw/ 上面有個 .test 因為,在設定檔中加上 ListOptions "-a" 明天再改成 ListOptions "+a" 你就看不見 .test 了 每個人的實做結果可能會不同,請勿心急。 本站目前的版本是 : proftpd-1.2.9_1 |
| tim | 發表時間: 2004-03-02 07:04 |
網站管理員 ![]() ![]() 註冊日: 2003-12-28 來自: Miaoli 發表數: 561 |
Re: ftp設定還是行不通! 要限制某一資料夾得存取權限,我的作法是使用「.ftpaccess」檔案。
本站 ftp 中有個 ISO-IMAGES 資料夾,存有 FreeBSD 的 iso 檔。 在其中設有 .ftpaccess 內容目前是 讓已知有使用 FreeBSD 的學校可以下載。 貴校若有在表列當中,自然看得見此資料夾。 匿名的 upload 功能,建議暫不開放。容易招蜂引蝶。 |
| JKK | 發表時間: 2004-03-02 15:04 |
Not too shy to talk ![]() ![]() 註冊日: 2004-03-01 來自: 發表數: 37 |
Re: ftp設定還是行不通! ListOptions的設定我會試試看(連帶.ftpaccess)
如果能成功,再於.ftpaccess做一些其他設定 我想再問一個問題,以下設定為何會無效? DisplayLogin welcome.msg DisplayFirstChdir .message 我看過貴站的ftp,msg訊息會出現在網頁的左側, 我設定的msg則沒有,這是怎麼一回事呢? 由於至目前為止,在proftp.conf沒有一樣成功,所以我對它心灰意冷。 至少要有一種設定確實可行,我才會繼續鑽研ftp,否則就直接告訴我,這爛貨不行了,沒用了,直接把它砍了吧。 |
| tim | 發表時間: 2004-03-02 15:16 |
網站管理員 ![]() ![]() 註冊日: 2003-12-28 來自: Miaoli 發表數: 561 |
Re: ftp設定還是行不通! 您的 FTP 帳號是否長得像這樣:
ftp:*:21:21::0:0:Anonymous FTP Admin:/home/ftp:/nonexistent proftpd.conf 建議先從底下的部份測試 ServerType standalone <Anonymous ~ftp> 或者,先回復成最原始的設定。 別氣餒,你好像才剛開始。路還很長喔。 |
| JKK | 發表時間: 2004-03-02 18:51 |
Not too shy to talk ![]() ![]() 註冊日: 2004-03-01 來自: 發表數: 37 |
Re: ftp設定還是行不通! 我的ftp的確不是如下的樣子
ftp:*:21:21::0:0:Anonymous FTP Admin:/home/ftp:/nonexistent 但是我光改pw檔有用嗎? 你說的我會照實去做,如果不行,就重新按裝了 對於程式,我認為最糟糕的是它完全相應不理,如果有10%成功,90%失敗,我會虛心接受,把失敗歸為自己的無知,但如果它完全相應不理,我可就想要開罵了,這死王八羔子(純粹發發脾氣) 我不是對proftpd有所偏見,但它目前在我電腦裡的反應就只能用爛字來形容,也許重新按裝會有所不同,我是這樣猜想的。 反正,就多試試就是了。 |
| tim | 發表時間: 2004-03-02 19:38 |
網站管理員 ![]() ![]() 註冊日: 2003-12-28 來自: Miaoli 發表數: 561 |
Re: ftp設定還是行不通! 記得上回再哪兒看到的,....,忘了。
proftpd.conf 中,建議加上一行: ScoreboardFile /var/run/proftpd.scoreboard 再試試看,別灰心。 PS. ListOptions "+a" 才是隱藏 DotFile PS 2. 貴站的 anonymous 資料夾好像已被攻擊了喔! |
| JKK | 發表時間: 2004-03-02 20:40 |
Not too shy to talk ![]() ![]() 註冊日: 2004-03-01 來自: 發表數: 37 |
Re: ftp設定還是行不通! 原來在anonymous那些雜七雜八的東西就是被攻擊的跡象,我把它給砍了。
再問一個我以前問過的問題,為何會出現如下訊息: ds55# /usr/local/etc/rc.d/proftpd.sh stop proftpd not running? (check /var/run/proftpd.pid) 為何我那proftpd.pid從不出現? 跑standalone不就是需要proftpd.sh? proftpd.sh裡不就說需要proftpd.pid? |
| tim | 發表時間: 2004-03-02 23:27 |
網站管理員 ![]() ![]() 註冊日: 2003-12-28 來自: Miaoli 發表數: 561 |
Re: ftp設定還是行不通! 引文:
先把這一行加上去: ScoreboardFile /var/run/proftpd.scoreboard 加上後再去交叉比對。 |
| JKK | 發表時間: 2004-03-03 07:02 |
Not too shy to talk ![]() ![]() 註冊日: 2004-03-01 來自: 發表數: 37 |
Re: ftp設定還是行不通! 大家早啊,一大早就談論程式碼有的沒有的,不曉得對一天的精神有什麼影響?
在proftpd.conf改為如下 #ServerType inetd ServerType standalone ListOptions "+a" ScoreboardFile /var/run/proftpd.scoreboard 在/etc/inetd.conf加上#ftp ##ftp stream tcp nowait root /usr/libexec/ftpd proftpd 並且 ds55# kill -HUP `cat /var/run/inetd.pid` ds55# /usr/local/etc/rc.d/proftpd.sh start Starting proftpd. 唉唷!這次居然出現下面出現我之前疑惑的二個檔案,時間就是剛才 -rw-r--r-- 1 root wheel 6 Mar 3 07:01 proftpd.pid -rw-r--r-- 1 root wheel 16 Mar 3 07:01 proftpd.scoreboard 再進入ftp:// 唉唷!該藏起來的都藏起來了,難道多那二行就是關鍵所在? 為何到昨天之前主機還出現check /var/run/proftpd.pid的訊息?今天就不同了? 不過,感謝大家,總算proftpd有起色了。 |
| tim | 發表時間: 2004-03-03 08:39 |
網站管理員 ![]() ![]() 註冊日: 2003-12-28 來自: Miaoli 發表數: 561 |
Re: ftp設定還是行不通! 引文:
原廠預設的 proftpd.conf 沒有 ScoreboardFile 的設定值, 而實際操作上,卻非得要有不可。 這幾乎是所有學 proftpd 的人必經的陣痛期。 嘿!你的人生有沒有看見彩色了呀! |
| 樹狀顯示 | 新的在前 | 前一個主題 | 下一個主題 | 頁首 |
| 無發表權 | |






