|
第十八章 架 設 FTP
Server
|
|
| 當 FTP Client 一開始要連上 FTP Server 時,會先隨機產生一個大於 1024 的 port (
假設 3000 port ),來主動對 FTP Server 的 21 port 做連線,等完成了 TCP 三段式交握以後,連線才正式建立起來
; 而這個 3000 port 與 21 port 所建立的連線通道就叫做命令通道 (command channel )。之所以會稱其為命令通道,當然是只能執行一些基本指令而已囉。 現在若是 Client 端想要下載或上傳資料時,還要另外建立起一條資料通道 (data channel ) 來作為資料傳輸使用。由於 Client 是採取主動模式 (可以想像 Client 要求 Server 做主動連線,也就是 Server 主動連 Client ),因此本身會再開啟另一個大於 1024 的 port ( 假設 5000 port ),然後透過命令通道通知 Server 已準備好這個 data channel 的連接埠,接著 Server 就以 20 port 來主動與 Client 端的 5000 port 建立連線,而在完成了另一次的三段式交握後,此 data channel 便建立起來,至此 Client 方可開始做資料傳輸。 |
| 一開始 command channel 的建立,與上面所述相同,不再重複,這裡只針對 data channel 的建立做說明。由於此時 Client 是希望採取被動模式 (可以想像 Client 要求 Server 做被動連線,也就是 Client 主動連 Server),所以會先透過 command channel 來通知 Server 這個訊息,Sever 收到後就隨機開啟一個大於 1024 的 port (假設 8000 port),並經由 command channel 知會 Client 已準備好 data channel 的連接埠,接著 Client 也隨機開啟一個大於 1024 的 port (假設 9000 port) 來主動與 Server 建立連線,而完成的三段式交握後,此 8000 port 與 9000 port 之間的 data channel 便建立起來了。 |
如您尚未安裝的話,使用 rpm 來直接從光碟安裝即可,不過得先將 mysql-shared、postgresql-libs 這兩個相依套件裝上,最後才能成功安裝 pure-ftpd ; 不然也可以利用 YaST 來自動幫您解決相依性的問題。 |
|
| suselinux:~ # vi
/etc/pure-ftpd/pure-ftpd.conf # Cage in every user in his home directory ChrootEveryone yes # 限定每一個使用者都只能在自己家目錄下活動。當設定成 no 時,則 Real User 可切換至其他 # 目錄做存取。 # If the previous option is set to "no", members of the following group won't be caged. Others will be. # If you don't want chroot()ing anyone,just comment out ChrootEveryone and TrustedGID. # TrustedGID 100 # 當您將註解拿掉後,GID 100 的群組成員會被視為信任的使用者,因此可以存取家目錄外的 # 其他目錄。此時無論 ChrootEveryone 設定為何,都是一樣的結果。 # Maximum number of simultaneous users MaxClientsNumber 10 # 限定最大連線數為 10。 # Maximum number of sim clients with the same IP address MaxClientsPerIP 3 # 限定同一來源端位址的最大連線數為 3。 # List dot-files even when the client doesn't send "-a". DisplayDotFiles yes # 這個參數設定成 yes 的話,則 Client 可以看到檔名是以 "." 作開始的隱藏檔。 # Don't allow authenticated users - have a public anonymous FTP only. AnonymousOnly yes # 是否只允許匿名登入。當您希望 Real User 也能登入時,就設定成 no。 # Disallow anonymous connections. Only allow authenticated users. NoAnonymous no # 是否不允許匿名登入。當設定成 no,表示允許匿名登入,但如果您希望只有 Real User 能經 # 由認證登入時,這裡就設定成 yes 吧。 # Syslog facility (auth, authpriv, daemon, ftp, security, user, local*) # The default facility is "ftp". "none" disables logging. SyslogFacility ftp # 您可以在 /etc/syslog.conf 裡使用 ftp 這個 facility,來告知 syslogd 要將 ftp 的相關訊息紀錄到 # 哪裡,比如: ftp.* /var/log/ftplog # Don't resolve host names in log files. Logs are less verbose, but it uses less bandwidth. Set this to "yes" # on very busy servers or if you don't have a working DNS. DontResolve yes # ftp 的紀錄檔是否不需解析主機名稱。 # Maximum idle time in minutes (default = 15 minutes) MaxIdleTime 15 # 設定 FTP Client 端的閒置時間為 15 分鐘。 # PureDB user database (see README.Virtual-Users) # PureDB /etc/pure-ftpd/pureftpd.pdb # 這是使用虛擬帳號登入時,所指定要使用的資料庫。 # If you want to enable PAM authentication, uncomment the following line. PAMAuthentication yes # 是否使用 PAM 認證模組來對使用者作認證。 # If you want simple Unix (/etc/passwd) authentication, uncomment this. # UnixAuthentication yes # 是否依照傳統的 /etc/passwd 來做認證。 # Are anonymous users allowed to create new directories ? AnonymousCanCreateDirs no # 是否允許 anonymous 建立新目錄。如設定成 yes,則 anonymous 雖可建立目錄,但無法刪除。 # Port range for passive connections replies. - for firewalling. # PassivePortRange 30000 50000 # 當 Client 端採用被動模式來建立資料通道時,FTP Server 預計所要使用 data channel 連接埠的範圍。 # 當您 Linux Client 端執行 ncftp 或 ftp 指令連上 FTP 站台後,可使用 passive 指令來變更連線模式。 # Upload/download ratio for anonymous users. # AnonymousRatio 1 10 # 設定 anonymous 上傳/下載比率。 # 以 1:10 而言,如果 anonymous 上傳了 1MB 的資料後,就能夠下載 10MB 的檔案資料。 # Upload/download ratio for all users. This directive superscedes the previous one. # UserRatio 1 10 # 設定 All User 上傳/下載比率。當 AnonymousRatio 及 UserRatio 都做設定時,是以 UserRatio 為主。 # Disallow downloading of files owned by "ftp", ie. # files that were uploaded but not validated by a local admin. AntiWarez yes # 匿名使用者要下載的檔案,如果其擁有者是 ftp 的話,則不允許下載。當您的 FTP 站台開放 anonymous 上傳時 (上 # 傳之後的檔案擁有者為 ftp),為了防止有些人會上傳一些有問題的檔案來供人下載,因此才設定這個參數 ; 而等 # 管理者確認上傳的檔案沒問題後,就可以把此檔的擁有者做個改變,這樣就能提供正常下載了。 # IP address/port to listen to (default=all IP and port 21). # Bind 127.0.0.1,21 # 設定 FTP Server 要在哪個介面位址監聽哪個 port。預設是允許在所有介面位址監聽 21 port。 # Maximum bandwidth for anonymous users in KB/s # AnonymousBandwidth 8 # 設定 anonymous 最大上傳、下載頻寬,單位為KB/s。 # Maximum bandwidth for *all* users (including anonymous) in KB/s. # Use AnonymousBandwidth *or* UserBandwidth, both makes no sense. # UserBandwidth 8 # 設定 All User 最大上傳、下載頻寬。當 AnonymousBandwidth 及 UserBandwidth 都設定時,是以 UserBandwidth 為主。 # File creation mask. <umask for files>:<umask for dirs> . 177:077 if you feel paranoid. Umask 177:077 # 設定上傳檔案、目錄 (含建立新目錄) 的預設權限,177:077 表示檔案的預設權限為 600,目錄為 700。 # Minimum UID for an authenticated user to log in. MinUID 100 # 設定能允許 Real User 認證登入的最小 UID 為 100,也就是說 UID 100 以上 (含100) 的使用者方可認證登入。 # 如您欲允許 root 登入的話,這個地方請註解起來,並且在 /etc/ftpusers 檔案中將 root 帳號移除。 # /etc/ftpusers 是用來設定拒絕登入 FTP Server 的使用者名單的。 # Users can't delete/write files beginning with a dot ('.') even if they own them. If TrustedGID is enabled, # this group will have access to dot-files, though. ProhibitDotFilesWrite yes # 是否要禁止使用者刪除或修改隱藏檔,即使使用者就是該隱藏檔的擁有者。設定 yes 就表示要禁止啦。 # Prohibit *reading* of files beginning with a dot (.history, .ssh...) ProhibitDotFilesRead no # 是否要禁止使用者讀取隱藏檔內容。當以上兩個參數都設定 no 時,表示使用者對隱藏檔具有 r 及 w 的權限 (anonymous # 為例外)。當 ProhibitDotFilesWrite 設定成 no,而 ProhibitDotFilesRead 設定成 yes 時,使用者是不能刪除檔案的。但是無論 # 如何設定,只要 TrustedGID 有設定時,則此群組的成員認證進來後是可以具有 r 及 w 的權限,並不會受到這裡的規範。 # Never overwrite files. When a file whoose name already exist is uploaded, # it get automatically renamed to file.1, file.2, file.3, ... AutoRename yes # 當上傳檔案時,若對方目錄內已經存在一個同檔名的檔案,則允許將上傳的那個檔案作自動更名的動作。 # Disallow anonymous users to upload new files (no = upload is allowed) AnonymousCantUpload yes # 是否要拒絕 anonymous 上傳。如要開放匿名使用者上傳檔案的話,就設定成 no。另外要允許上傳目錄時,除了這裡要 # 設定成 no 以外,AnonymousCanCreateDirs 參數需設定成 yes 才行。 # Disallow the CHMOD command. Users can't change perms of their files. #NoChmod yes # 是否要拒絕使用者執行 chmod 指令來修改權限。 # Allow users to resume and upload files, but *NOT* to delete them. #KeepAllFiles yes # 當設定成 yes 時,表示使用者無法刪除伺服器上的檔案。 # Automatically create home directories if they are missing #CreateHomeDir yes # 當使用者家目錄不存在,是否要自動建立起來。 # This option is useful with servers where anonymous upload is allowed. As /var/ftp is in /var, it save some # space and protect the log files. When the partition is more that X percent full,new uploads are disallowed. MaxDiskUsage 99 # 假使我們將 anonymous 的家目錄改成 /var/ftp (修改 /etc/passwd ),然後又設定允許匿名使用者上傳,那這個參數就很好用 # 了,因為當 /var partition 的使用空間達 99% 時,就不允許匿名使用者再上傳資料,不然 /var/log 目錄下的那些記錄檔可就 # 無法持續記錄一些重要資訊了。 # Set to 'yes' if you don't want your users to rename files. NoRename yes # 是否要拒絕使用者修改檔案目錄的名稱 (重新命名)。 |
| suselinux:~ # rcpure-ftpd start |
| suselinux:~ # chkconfig pure-ftpd 35 |
| 1. | 設定 pure-ftpd.conf:
|
|||||||
| 2. | 建立虛擬帳號所共用的一個 ftp 專屬帳號 :
|
|||||||
| 3. | 使用 pure-pw 指令來建立虛擬帳號:
|
| suselinux:~ # pure-pw
usermod tina -t 100 -T 50 -q 1 -Q 10 -n 30 -N 2 -z 1400-2230 \ > -r 192.168.5.0/24,192.168.1.0/24 -m
檢驗一下設定後的結果: suselinux:~ # pure-pw show tina
修改 tina 的密碼: suselinux:~ # pure-pw passwd tina -m Password: Enter it again: 刪除 tina 帳號: suselinux:~ # pure-pw userdel tina -m |
| suselinux:~ #
rpm
-qa | grep vsftpd vsftpd-1.2.1-69.3 suselinux:~ # rpm -ql vsftpd /etc/logrotate.d/vsftpd 設定紀錄檔 /var/log/vsftpd.log 輪替的檔案。 /etc/pam.d/vsftpd vsftpd 的 PAM 認證模組設定檔。 /etc/vsftpd.conf vsftpd 的主要設定檔。 /etc/xinetd.d/vsftpd SUSE 預設是以 xinetd 的方式來啟動的噢。 /usr/sbin/vsftpd vsftpd 的執行主程式 (daemon)。 |
| suselinux:~ #
vi /etc/xinetd.d/vsftpd service ftp { socket_type = stream protocol = tcp wait = no user = root server = /usr/sbin/vsftpd disable = no # 把 yes 改成 no 即可。 } |
| suselinux:~ #
rcxinetd restart Shutting down xinetd: done Starting INET services. (xinetd) done |
| suselinux:~ #
vi /etc/vsftpd.conf ###### General Settings ###### # Uncomment this to enable any form of FTP write command. # write_enable=YES # 預設為 NO。是否讓使用者擁有寫入的權限。 # 當指定為 YES 時,才能讓 anon_upload_enable、anon_mkdir_write_enable、anon_other_write_enable # 這些參數設定成 YES 時生效。另外這裡若設定成 NO,則連 realuser 在自己家目錄下也不具 # 有寫入的權限。 # Activate directory messages - messages given to remote users when they # go into a certain directory. dirmessage_enable=YES # 預設為 NO。當使用者切換至某個目錄時,是否要顯示該目錄下 .message (預設) 檔案內的訊 # 息。當然您也可以透過 message_file 參數,來指定不同的檔案。 # message_file=.message # 預設為 .message。當上一個參數指定為 YES 時,如不想使用預設的 .message 檔案,就可以 # 利用這個 message_file 參數來指定另一個檔名。 # It is recommended that you define on your system a unique user which the # ftp server can use as a totally isolated and unprivileged user. # # nopriv_user=ftpsecure # 預設為 nobody。這是設定以哪個帳號來執行 vsftpd 的服務。 # You may fully customise the login banner string: # ftpd_banner="Welcome to FOOBAR FTP service." # 預設不顯示。設定使用者登入 ftp 時,會看到的訊息。如果要提供的訊息內容很多時,則可 # 事先將這些訊息設定在某個檔案內,然後再利用 banner_file 參數去指定,如下: # banner_file=/etc/welcomefile # You may specify a file of disallowed anonymous e-mail addresses. Apparently # useful for combatting certain DoS attacks. # deny_email_enable=YES # 預設為 NO。是否要拒絕匿名使用者輸入特定的 E-Mail 密碼。 # (default follows) # banned_email_file=/etc/vsftpd.banned_emails # 當 deny_email_enable =YES 時,可以把所要拒絕登入的 E-Mail 密碼設定在預設的 # /etc/vsftpd.banned_emails 檔案內。不過請您注意一點,當 deny_email_enable=YES 時,如預設的 # vsftpd.banned_emails 檔案並不存在,那將會造成所有使用者都無法登入。 # no_anon_password=YES # Uncomment this to allow local users to log in. local_enable=YES # 預設為 NO。是否允許在本機擁有真實帳號 (realuser) 的使用者登入。這裡的設定是允許囉。 # Default umask for local users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) # local_umask=022 # 預設為 077。這是設定 realuser 上傳檔案目錄時的預設權限。如以 local_umask=022 而言,上傳 # 目錄或新增目錄時的預設權限就是 755,上傳檔案則為 644。 # Uncomment to put local users in a chroot( ) jail in their home directory # after login. # chroot_local_user=YES # 預設為 NO。是否限定 realuser 登入後,以其家目錄作為預設的根目錄位置。若設定成 YES, # 則 realuser 就只能在自己家目錄下活動,無法切換到家目錄以外的範圍。 # You may specify an explicit list of local
users to chroot( ) to their home # local authenticated users. The default is 0 (unlimited). # local_max_rate=7200 # 預設為 0。設定 realuser 上傳及下載的傳輸速率,單位為 bytes/sec。而預設值 0 表示不設限。 # user_config_dir=/etc/vsftpd/limitdir # 我們可以利用這個參數來個別設定使用者的傳輸頻寬,比如想限定使用者 barry 的上傳下載 # 頻寬,可以至 /etc/limitdir 目錄下去建立一個 barry 檔案 ,然後再把 local_max_rate 參數設定進 # 去就行了。 # guest_enable=YES # 預設為 NO。當 realuser 登入時,是否要將其身份轉換成訪客。若設定成 YES 時,則可以 # 利用 guest_username 參數來指定訪客的身份,如未指定,則預設為 ftp。 # guest_username=guest # 預設為 ftp。當 guest_username=YES 時才有作用。 ###### Anonymus FTP user Settings ###### # Allow anonymous FTP? anonymous_enable=YES # 預設為 YES。是否允許匿名使用者 (anonymous) 登入。 # Anonymous users will only be allowed to download files which are # world readable. anon_world_readable_only=YES # 預設為 YES。當其他人 (others) 對檔案具有可讀權限時,是否允許 anonymous 下載。 # Uncomment this to allow the anonymous FTP user to upload files. This only # has an effect if the above global write enable is activated. Also, you will # obviously need to create a directory writable by the FTP user. # anon_upload_enable=YES # 預設為 NO。是否允許匿名使用者上傳檔案。如果設定允許的話,則在 Server 上,您必須 # 事先建立一個可以讓 anonymous 擁有寫入權限的目錄才行。 # Default umask for anonymus users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) # anon_umask=077 # 預設為 077。設定 anonymous 上傳檔案目錄時的預設權限。 # Uncomment this if you want the anonymous FTP user to be able to create # new directories. # anon_mkdir_write_enable=YES # 預設為 NO。設定是否允許匿名使用者建立新目錄或上傳目錄。 # Uncomment this to enable anonymus FTP users to perform other write operations # like deletion and renaming. # anon_other_write_enable=YES # 預設為 NO。是否允許匿名使用者具備其他的寫入權限,比如刪除檔案目錄,或對檔案目錄 # 名稱重新命名等。 # If you want, you can arrange for uploaded anonymous files to be owned by # a different user. Note! Using "root" for uploaded files is not # recommended! # chown_uploads=YES # 預設為 NO。匿名使用者上傳檔案後,是否允許安排檔案的擁有者為另一個使用者而非 ftp。 # 若設定成 YES,可搭配 chown_username 參數,去指定該檔案的擁有者是誰,如沒指定,則預 # 設為 root。請注意這裡是只針對上傳的檔案而言,目錄在這個地方並不適用。 # chown_username=whoever # 預設為 root。需搭配 chown_uploads=YES 來設定。 # The maximum data transfer rate permitted, in bytes per second, for anonymous # authenticated users. The default is 0 (unlimited). # anon_max_rate=7200 # 預設為 0。設定 anonymous 上傳及下載的傳輸速率,單位為 bytes/sec。而預設值 0 表示不設限。 ###### Log Settings ###### # Log to the syslog daemon instead of using an logfile. syslog_enable=YES # 預設為 NO。當設定成 YES 時,會把原本要紀錄到 /var/log/vsftpd.log 中的 ftp 資訊,改依 # syslogd daemon 所主要參考的檔案 syslog.conf,來決定把 ftp 相關訊息紀錄到哪裡,以 SUSE # 而言,就是指 /var/log/messages。 # Uncomment this to log all FTP requests and responses. # log_ftp_protocol=YES # 預設為 NO。是否要將所有 ftp 的需求及回應都紀錄下來。 # Activate logging of uploads/downloads. # xferlog_enable=YES # 預設為 NO。是否要將 ftp 的上傳/下載資訊記錄下來。 # 若設定 YES,則預設會紀錄在 /var/log/vsftpd.log 檔案中。 # You may override where the log file goes if you like. The default is shown # below. # vsftpd_log_file=/var/log/vsftpd.log # 當 xferlog_enable=YES 時,預設就是記錄在這個檔案。欲指定另一個檔案就修改這個參數囉。 # If you want, you can have your log file in standard ftpd xferlog format # xferlog_std_format=YES # 預設為 NO。是否以 wu-ftpd 標準的 xferlog 格式,來作為記錄檔的紀錄格式。當設定成 YES # 時,預設的紀錄檔為 /var/log/xferlog。 # You may override where the log file goes if you like. The default is shown # below. # xferlog_file=/var/log/xferlog # 當 xferlog_std_format=YES 時,預設就是記錄在這個檔案。欲指定另一個檔案時,就修改這個 # 參數囉。 # Enable this to have booth logfiles. Standard xferlog and vsftpd's own style log. # dual_log_enable=YES # 預設為 NO。當設定為 YES 時,會同時將 ftp 資訊紀錄在 /var/log/xferlog 及 /var/log/vsftpd.log 中。 ###### Transfer Settings ###### # Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES # 預設為 NO。在主動模式下建立資料通道時,是否啟用 20 port。 # You may change the default value for timing out an idle session. # idle_session_timeout=600 # 預設為 300 秒。設定使用者所能閒置的最大秒數。若設定 100 秒,就表示使用者在 100 秒內 # 都沒執行任何命令動作時,將會被斷線。 # You may change the default value for timing out a data connection. # data_connection_timeout=120 # 預設為 300 秒。設定資料傳輸時所能閒置的秒數。 # ascii_upload_enable=YES # 預設為 NO。是否允許以 ASCII 格式來上傳資料。 # ascii_download_enable=YES # 預設為 NO。是否允許以 ASCII 格式來下載資料。以上兩個參數,建議都採用預設值 NO, # 以防止 DOS 攻擊。 # Set to NO if you want to disallow the PASV method of obtaining a data # connection. # pasv_enable=YES # port_enable=YES # 預設皆為 YES。是否允許 client 端使用主動模式或被動模式來建立連線。 # PAM setting. Do NOT change this unless you know what you do! pam_service_name=vsftpd # 預設為 ftp。這裡是指定 vsftpd 所使用 pam 的服務名稱為 vsftpd,其路徑為 /etc/pam.d/vsftpd。 # Set listen=YES if you want vsftpd to run standalone # listen=YES # 預設為 NO。是否以 standalone 的方式來啟動 vsftpd 服務。如採用預設值,則表示您想使用 # xinetd 的方式來啟動 vsftpd。 # listen_port=21 # 預設為 21 port。設定在建立命令通道時所使用的 port number。 # tcp_wrappers=YES # 預設為 NO。是否讓 /usr/sbin/vsftpd 支援 tcp_wrappers。若設定成 YES,則連線進來的封包將會 # 經過 /etc/hosts.allow 及 /etc/hosts.deny 的過濾。 # 這個參數是特別針對以 standalone 方式來啟動 vsftpd 服務而設計的,若您是使用 xinetd 來啟動 # 的話,不管 tcp_warppers 參數設定為何,都會使用到 tcpd 的過濾機制。 # max_clients=20 # 預設為 0。以 standalone 來啟動 vsftpd 前提下,限定 client 端的最大連線數為何。 # 預設值 0, 表示不限制連線數。 # pasv_min_port=8000 # pasv_max_port=9000 # 預設皆為 0。設定被動模式下建立資料通道時,所啟用的 data port number 的範圍。 # 預設值 0 ,表示 any port 之意。 |
| 1. | 一般設定:
|
|||||||
| 2. | Realuser 相關設定:
|
|||||||
| 3. | Anonymous 相關設定:
|
|||||||
| 4. | Log 相關設定: 將使用者上傳/下載的資訊,同時紀錄在 /var/log/vsftpd.log 及 /var/log/xferlog 中。 |
|||||||
| 5. | 檔案傳輸設定:
|
| suselinux:~ #
vi /etc/vsftpd.conf ###### 一般設定 ###### write_enable=YES banner_file=/etc/welcomefile use_localtime=YES ###### RealUser 相關設定 ###### local_enable=YES chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list local_max_rate=80000 user_config_dir=/etc/limitdir ###### Anonymous 相關設定 ###### anonymous_enable=YES anon_world_readable_only=YES anon_upload_enable=YES anon_umask=077 anon_mkdir_write_enable=NO anon_other_write_enable=NO anon_max_rate=50000 ###### Log 相關設定 ###### xferlog_enable=YES vsftpd_log_file=/var/log/vsftpd.log xferlog_std_format=YES xferlog_file=/var/log/xferlog dual_log_enable=YES ###### 檔案傳輸設定 ###### idle_session_timeout=180 data_connection_timeout=120 ascii_upload_enable=NO ascii_download_enable=NO pam_service_name=vsftpd listen=NO |
設定完成後,請重新啟動 xinetd:
| suselinux:~ #
rcxinetd restart Shutting down xinetd: done Starting INET services. (xinetd) done |
| 1. 設定登入 FTP 時的顯示訊息: suselinux:~ # vi /etc/welcomefile ########################################### ########## Welcome to barry's FTP Site ########## ########################################### 2. 設定只有 barry 及 david 登入後,不會被侷限在家目錄下活動: suselinux:~ # vi /etc/vsftpd.chroot_list barry david 3. 拒絕 mary 及 tina 登入 FTP 站台: suselinux:~ # vi /etc/ftpusers :略 root squid uucp wwwrun mary tina # 要讓 /etc/ftpusers 這個檔案產生效用,須確定在 vsftpd.conf 中的 pam_service_name 參數指定為 # vsftpd 才行。由於這裡是牽涉到 PAM 模組設定的問題,所以就先不提了。 4. 限定 barry 及 david 的最大傳輸速度: suselinux:~ # mkdir /etc/limitdir suselinux:~ # vi /etc/limitdir/barry local_max_rate=200000 # david 的做法,也請如法炮製一番。 5. 設定 anonymous 的上傳目錄: suselinux:~ # mkdir /srv/ftp/upload suselinux:~ # chown ftp /srv/ftp/upload → 將上傳目錄的擁有者改為 ftp,不然 anonymous 是無法上傳資料的噢。 |
到這裡,整個 FTP 的設定才算完成。接著您就可以開始根據您實際的要求,來嘗試設定適合自己環境了噢。
copyright © 2005 by barry ( 柏青哥
)