1。操作環(huán)境是Redhat9.0,vsFTPd的版本是Redhat9.0所帶的vsftpd-1.1.3-8.i386.rpm,在安裝盤的第三張中
2。vsFTPd實現的最基本的目的:用系統中存在的真實用戶能登入FTP,能用匿名訪問。
3。vsFTPd運行模式是在standalone模式下運行的,也就是說,本帖中vsFTPd所有的功能都是在standalone模式下運行的。至于有些功能是否能在xinetd模式下運行,您就得測試了,不能照搬照抄。因為有些功能是必須運行在特定的模式下的。
3。服務器的IP和和DNS設定
第一塊網卡
IP:192.168.0.1
子掩碼:255.255.255.0
網關不設置:
第二塊網卡:
IP:192.168.0.2
子掩碼:255.255.255.0
網關不設置
因為我的操作環(huán)境是一個小型的局域網,所以其它的機器的IP都是在192.168.0這個網段上。ADSL是接在服務器的第一個網卡上。服務器的第二個網卡是接集線器,其它的客戶機都是接在集線器上。為了能讓ADSL訪問internet,因為自己手動設置了IP,所以DNS也要自己來設置,DNS如下:
202.96.134.133
202.96.168.68
設置工具是:
[root@linuxsir001root]#redhat-config-network
一。用vsFTPd來架設FTP服務器,vsFTPd服務器是目前最好的FTP服務器軟件,優(yōu)點是體積小,可定制強,效率高
1。查看是否安裝了vsFTPd軟件
[root@linuxsir001root]#rpm-qa|grepvsftpd
如果沒有任何顯示,說明沒有把vsFTPd安裝上,如果出現的是下面的這樣的提示,就證明已經安裝上了。
[root@linuxsir001root]#rpm-qa|grepvsftpd
vsftpd-1.1.3-8
我以Redhat9.0,以其自帶的vsFTPd包vsftpd-1.1.3-8版本來為本帖約定。
[root@linuxsir001root]#rpm-ivhvsftpd*.rpm
2。打開vsFTPd服務器。
[root@linuxsir001root]#ntsysv
把vsftpd服務器打開,也就是在運行ntsysv命令后,把vsftpd服務選中。
vsftpd
3。運行/etc/init.d/vsftpdstart
[root@linuxsir001root]#/etc/init.d/vsftpdstart
為vsftpd啟動vsftpd:[確定]
[root@linuxsir001root]#
4。配制vsFTPd,vsFTPd的運行有兩種模式,一種是standalone"initd"模式,另外一種是xinetd模式,上面我們所說的就是standalone"initd"運行模式。兩種模式運行機制不是相同的,stardardinitd模式,適合專業(yè)FTP,且FTP總是一直有人訪問,占用資源也是比較大,如果您的FTP總是有人訪問和登入。就要用這種模式。如果您的FTP訪問人數比較小,建議您用xinetd模式。xinetd模式,是當用戶請求時,vsFTPd才會啟動。
不同的環(huán)境,當然得用不同的啟動模式。
1]我們主要把vsFTPd的配制文件改一下就行了。配制文件在/etc/vsftpd/vsftpd.conf,用您喜歡的編輯器打開。請參考下面的配制文件。
#Exampleconfigfile/etc/vsftpd.conf
#
#Thedefaultcompiledinsettingsareveryparanoid.Thissamplefile
#loosensthingsupabit,tomaketheftpdaemonmoreusable.
#
#AllowanonymousFTP?
anonymous_enable=YES
#
#Uncommentthistoallowlocaluserstologin.
local_enable=YES
#
#UncommentthistoenableanyformofFTPwritecommand.
write_enable=YES
#
#Defaultumaskforlocalusersis077.Youmaywishtochangethisto022,
#ifyourusersexpectthat(022isusedbymostotherftpd's)
local_umask=022
#
#UncommentthistoallowtheanonymousFTPusertouploadfiles.Thisonly
#hasaneffectiftheaboveglobalwriteenableisactivated.Also,youwill
#obviouslyneedtocreateadirectorywritablebytheFTPuser.
#anon_upload_enable=YES
#
#UncommentthisifyouwanttheanonymousFTPusertobeabletocreate
#newdirectories.
#anon_mkdir_write_enable=YES
#
#Activatedirectorymessages-messagesgiventoremoteuserswhenthey
#gointoacertaindirectory.
dirmessage_enable=YES
#
#Activateloggingofuploads/downloads.
xferlog_enable=YES
#
#MakesurePORTtransferconnectionsoriginatefromport20(ftp-data).
connect_from_port_20=YES
#
#Ifyouwant,youcanarrangeforuploadedanonymousfilestobeownedby
#adifferentuser.Note!Using"root"foruploadedfilesisnot
#recommended!
#chown_uploads=YES
#chown_username=whoever
#
#Youmayoverridewherethelogfilegoesifyoulike.Thedefaultisshown
#below.
#xferlog_file=/var/log/vsftpd.log
#
#Ifyouwant,youcanhaveyourlogfileinstandardftpdxferlogformat
xferlog_std_format=YES
#
#Youmaychangethedefaultvaluefortimingoutanidlesession.
#idle_session_timeout=600
#
#Youmaychangethedefaultvaluefortimingoutadataconnection.
#data_connection_timeout=120
#
#Itisrecommendedthatyoudefineonyoursystemauniqueuserwhichthe
#ftpservercanuseasatotallyisolatedandunprivilegeduser.
#nopriv_user=ftpsecure
#
#EnablethisandtheserverwillrecogniseasynchronousABORrequests.Not
#recommendedforsecurity(thecodeisnon-trivial).Notenablingit,
#however,mayconfuseolderFTPclients.
#async_abor_enable=YES
#
#BydefaulttheserverwillpretendtoallowASCIImodebutinfactignore
#therequest.TurnonthebelowoptionstohavetheserveractuallydoASCII
#manglingonfileswheninASCIImode.
#Bewarethatturningonascii_download_enableenablesmaliciousremoteparties
#toconsumeyourI/Oresources,byissuingthecommand"SIZE/big/file"in
#ASCIImode.
#TheseASCIIoptionsaresplitintouploadanddownloadbecauseyoumaywish
#toenableASCIIuploads(topreventuploadedscriptsetc.frombreaking),
#withouttheDoSriskofSIZEandASCIIdownloads.ASCIImanglingshouldbe 本文出自:億恩科技【www.laynepeng.cn】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]
|