当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > VSFTPd自架Linux网络服务器方法

Linux服务器
Linux下利用Squid构建高速的ProxyServer
在Linux操作系统上配置DNS服务器的日志
搭建性能比Squid高很多的Varnish服务器
Linux系统挂载AIXNFS服务器的配置方法
Linux上架设一台高容量POP3服务器
鸟哥的Linux学习笔记DNS服务器知识
部署Linux下OpenVZ虚拟化服务器
在RHEL5服务器上远程桌面(VNC)的配置
Samba服务器多系统用户共享目录设计方法
Linux攻略Samba服务的搭建与配置
Linux操作系统下配置DNS服务器的方法介绍
用Linux系统自身做一个L2TP的VPN服务器
Linux环境用Sendmail架设Mail服务器
细述Apachewebserver的安装与配置
linux环境下轻松搭建CVS服务器
UbuntuLinux通过SSh远程管理服务器
Linux操作系统下DHCP中继代理的实现方法
Ubuntu7.10Linux上构建全功能的服务器
Linux系统搭建Discuz论坛的方法
Ubuntub7.10Linux架设Samba服务

Linux服务器 中的 VSFTPd自架Linux网络服务器方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 59 ::
收藏到网摘: n/a

1。操作环境是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
网关不设置

因为我的操作环境是一个小型的局域网,所以其它的机器的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服务器软件,优点是体积小,可定制强,效率高

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模式,适合专业FTP,且FTP总是一直有人访问,占用资源也是比较大,如果您的FTP总是有人访问和登入。就要用这种模式。如果您的FTP访问人数比较小,建议您用xinetd模式。xinetd模式,是当用户请求时,vsFTPd才会启动。



不同的环境,当然得用不同的启动模式。

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
#ontheclientanyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
#Youmayfullycustomisetheloginbannerstring:
#ftpd_banner=WelcometoblahFTPservice.
#
#Youmayspecifyafileofdisallowedanonymouse-mailaddresses.Apparently
#usefulforcombattingcertainDoSattacks.
#deny_email_enable=YES
#(defaultfollows)
#banned_email_file=/etc/vsftpd.banned_emails
#
#Youmayspecifyanexplicitlistoflocaluserstochroot()totheirhome
#directory.Ifchroot_local_userisYES,thenthislistbecomesalistof
#userstoNOTchroot().
#chroot_list_enable=YES
#(defaultfollows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
#Youmayactivatethe"-R"optiontothebuiltinls.Thisisdisabledby
#defaulttoavoidremoteusersbeingabletocauseexcessiveI/Oonlarge
#sites.However,somebrokenFTPclientssuchas"ncftp"and"mirror"assume
#thepresenceofthe"-R"option,sothereisastrongcaseforenablingit.
#ls_recurse_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
#enableforstandalonemode
listen=YES
tcp_wrappers=YES

2]更改完配制文件后,我们可以用下面的命令来重启vsFTPd服务器

[root@linuxsir001root]#/etc/init.d/vsftpdrestart
关闭vsftpd:[确定]
为vsftpd启动vsftpd:[确定]
[root@linuxsir001root]#

3]以匿名方式来访问测试,在text模式下:

注意:在text模式下,要用用户名ftp,密码ftp来访问,这才是在text中匿名访问FTP。看如下的操作:

[root@linuxsir001root]#ftp192.168.0.1
Connectedto192.168.0.1.
220(vsFTPd1.1.3)
530PleaseloginwithUSERandPASS.
530Pleaselogin

上一页[1][2]