linux社区爱心援助Linux认证系列教程业界动态站务新闻公司招聘建议留言网址大全LPI专题CISCO专题
设为首页
加入收藏
管理团队
JSP  
JAVA  
PERL  
 您的位置:首页 > article > linux网络与应用 > Linux服务器 >
栏目导栏
资料搜索
热门文章
·Linux网关设置
·WebLogic管理精华
·Webmin的下载与安装
·RedHat Linux 9.0 Samba配置详
·网吧LINUX游戏服务器加迅闪更新
·Linux下配置完整安全的DHCP服务
·Tomcat性能调整
·Linux下FTP服务器配置
·怎样设置域名的DNS服务器
·linux9.0+apache+php+mysql安装
·Eclipse+Tomcat+MyEclipse配置
·Linux服务器网卡驱动安装及故障
·Linux网络服务器配置详解
·FC5+Apache2+PHP5+MYSQL5环境配
·让linux系统支持ASP
最新文章
·Slackware EyooLinux服务器配置
·Linux系统下安装bind后配置实现
·Fedora Linux系统Samba服务器架
·服务器维护:RHEL 5系统下故障
·服务器应用:实现Linux与宿主机
·RED HAT AS4 U4下Gssftp服务的
·高手进阶:Redhat Linux上vsft
·Fedora Linux操作系统中TFTP的
·Ubuntu Linux操作系统安装配置
·Linux FTP服务器和SVN服务器的
·Linux操作系统下自带BIND的使用
·Linux系统下DNS服务器的架设
·Linux下Apache安装/增加mod_re
·虚拟磁盘Linux服务端测试及故障
·为网络启动和软硬件升级建立TF
Google
 
VSFTPd自架Linux操作系统网络服务器方法
[ 作者:  加入时间:2007-08-20 10:16:31  来自:Linux联盟收集整理 ]

约定:rEZLinux联盟
  1。本帖操作环境是Redhat 9.0,vsFTPd的版本是Redhat 9.0所带的vsftpd-1.1.3-8.i386.rpm,在安装盘的第三张中rEZLinux联盟
  rEZLinux联盟
  2。vsFTPd实现的最基本的目的:用系统中存在的真实用户能登入FTP,能用匿名访问。rEZLinux联盟
  rEZLinux联盟
  3。本帖中vsFTPd运行模式是在standalone模式下运行的,也就是说,本帖中vsFTPd所有的功能都是在standalone模式下运行的。至于有些功能是否能在xinetd模式下运行,您就得测试了,不能照搬照抄。因为有些功能是必须运行在特定的模式下的。rEZLinux联盟
  rEZLinux联盟
  3。服务器的IP和和DNS设定rEZLinux联盟
  rEZLinux联盟
  第一块网卡rEZLinux联盟
  IP:192.168.0.1rEZLinux联盟
  子掩码:255.255.255.0rEZLinux联盟
  网关不设置:rEZLinux联盟
  第二块网卡:rEZLinux联盟
  IP:192.168.0.2rEZLinux联盟
  子掩码:255.255.255.0rEZLinux联盟
  网关不设置rEZLinux联盟
  rEZLinux联盟
  因为我的操作环境是一个小型的局域网,所以其它的机器的IP都是在192.168.0这个网段上。ADSL是接在服务器的第一个网卡上。服务器的第二个网卡是接集线器,其它的客户机都是接在集线器上。为了能让ADSL访问internet,因为自己手动设置了IP,所以DNS也要自己来设置,DNS如下:rEZLinux联盟
  rEZLinux联盟
  202.96.134.133rEZLinux联盟
  202.96.168.68rEZLinux联盟
  rEZLinux联盟
  设置工具是:rEZLinux联盟
  [root@linuxsir001 root]# redhat-config-networkrEZLinux联盟
  rEZLinux联盟
  相应参考资料:vsFTPd官方文档:rEZLinux联盟
  rEZLinux联盟
  http://www.linuxsir.com/bbs/showthr...;threadid=43451rEZLinux联盟
  rEZLinux联盟
  一。用vsFTPd来架设FTP服务器,vsFTPd服务器是目前最好的FTP服务器软件,优点是体积小,可定制强,效率高rEZLinux联盟
  rEZLinux联盟
  1。查看是否安装了vsFTPd软件rEZLinux联盟
  [root@linuxsir001 root]# rpm -qa | grep vsftpdrEZLinux联盟
  如果没有任何显示,说明没有把vsFTPd安装上,如果出现的是下面的这样的提示,就证明已经安装上了。rEZLinux联盟
  rEZLinux联盟
  [root@linuxsir001 root]# rpm -qa | grep vsftpdrEZLinux联盟
  vsftpd-1.1.3-8rEZLinux联盟
  rEZLinux联盟
  我以Redhat 9.0,以其自带的vsFTPd包vsftpd-1.1.3-8版本来为本帖约定。rEZLinux联盟
  rEZLinux联盟
  [root@linuxsir001 root]# rpm -ivh vsftpd*.rpm rEZLinux联盟
  rEZLinux联盟
  2。打开vsFTPd服务器。rEZLinux联盟
  rEZLinux联盟
  [root@linuxsir001 root]# ntsysvrEZLinux联盟
  rEZLinux联盟
  把vsftpd服务器打开,也就是在运行 ntsysv命令后,把vsftpd服务选中。rEZLinux联盟
  rEZLinux联盟
  [*] vsftpd rEZLinux联盟
  rEZLinux联盟
  3。运行/etc/init.d/vsftpd startrEZLinux联盟
  rEZLinux联盟
  [root@linuxsir001 root]# /etc/init.d/vsftpd startrEZLinux联盟
  为 vsftpd 启动 vsftpd: [ 确定 ]rEZLinux联盟
  [root@linuxsir001 root]#rEZLinux联盟
  rEZLinux联盟
  4。配制vsFTPd,vsFTPd的运行有两种模式,一种是standalone "initd"模式,另外一种是xinetd模式,上面我们所说的就是standalone "initd"运行模式。两种模式运行机制不是相同的,stardard initd模式,适合专业FTP,且FTP总是一直有人访问,占用资源也是比较大,如果您的FTP总是有人访问和登入。就要用这种模式。如果您的FTP访问人数比较小,建议您用xinetd模式。xinetd模式,是当用户请求时,vsFTPd才会启动。rEZLinux联盟
  rEZLinux联盟
  不同的环境,当然得用不同的启动模式。rEZLinux联盟
  rEZLinux联盟
  如果想了解更多的,请在本帖后面跟帖,我会慢慢补充xinetd模式,以及虚拟用户如何设置方面的问题。rEZLinux联盟
  rEZLinux联盟
  1]我们主要把vsFTPd的配制文件改一下就行了。配制文件在/etc/vsftpd/vsftpd.conf,用您喜欢的编辑器打开。请参考下面的配制文件。rEZLinux联盟
  rEZLinux联盟
  # Example config file /etc/vsftpd.confrEZLinux联盟
  #rEZLinux联盟
  # The default compiled in settings are very paranoid. This sample filerEZLinux联盟
  # loosens things up a bit, to make the ftp daemon more usable.rEZLinux联盟
  #rEZLinux联盟
  # Allow anonymous FTP?rEZLinux联盟
  anonymous_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # Uncomment this to allow local users to log in.rEZLinux联盟
  local_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # Uncomment this to enable any form of FTP write command.rEZLinux联盟
  write_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # Default umask for local users is 077. You may wish to change this to 022,rEZLinux联盟
  # if your users expect that (022 is used by most other ftpd's)rEZLinux联盟
  local_umask=022rEZLinux联盟
  #rEZLinux联盟
  # Uncomment this to allow the anonymous FTP user to upload files. This onlyrEZLinux联盟
  # has an effect if the above global write enable is activated. Also, you willrEZLinux联盟
  # obviously need to create a directory writable by the FTP user.rEZLinux联盟
  #anon_upload_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # Uncomment this if you want the anonymous FTP user to be able to createrEZLinux联盟
  # new directories.rEZLinux联盟
  #anon_mkdir_write_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # Activate directory messages - messages given to remote users when theyrEZLinux联盟
  # go into a certain directory.rEZLinux联盟
  dirmessage_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # Activate logging of uploads/downloads.rEZLinux联盟
  xferlog_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # Make sure PORT transfer connections originate from port 20 (ftp-data).rEZLinux联盟
  connect_from_port_20=YESrEZLinux联盟
  #rEZLinux联盟
  # If you want, you can arrange for uploaded anonymous files to be owned byrEZLinux联盟
  # a different user. Note! Using "root" for uploaded files is notrEZLinux联盟
  # recommended!rEZLinux联盟
  #chown_uploads=YESrEZLinux联盟
  #chown_username=whoeverrEZLinux联盟
  #rEZLinux联盟
  # You may override where the log file goes if you like. The default is shownrEZLinux联盟
  # below.rEZLinux联盟
  #xferlog_file=/var/log/vsftpd.logrEZLinux联盟
  #rEZLinux联盟
  # If you want, you can have your log file in standard ftpd xferlog formatrEZLinux联盟
  xferlog_std_format=YESrEZLinux联盟
  #rEZLinux联盟
  # You may change the default value for timing out an idle session.rEZLinux联盟
  #idle_session_timeout=600rEZLinux联盟
  #rEZLinux联盟
  # You may change the default value for timing out a data connection.rEZLinux联盟
  #data_connection_timeout=120rEZLinux联盟
  #rEZLinux联盟
  # It is recommended that you define on your system a unique user which therEZLinux联盟
  # ftp server can use as a totally isolated and unprivileged user.rEZLinux联盟
  #nopriv_user=ftpsecurerEZLinux联盟
  #rEZLinux联盟
  # Enable this and the server will recognise asynchronous ABOR requests. NotrEZLinux联盟
  # recommended for security (the code is non-trivial). Not enabling it,rEZLinux联盟
  # however, may confuse older FTP clients.rEZLinux联盟
  #async_abor_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # By default the server will pretend to allow ASCII mode but in fact ignorerEZLinux联盟
  # the request. Turn on the below options to have the server actually do ASCIIrEZLinux联盟
  # mangling on files when in ASCII mode.rEZLinux联盟
  # Beware that turning on ascii_download_enable enables malicious remote partiesrEZLinux联盟
  # to consume your I/O resources, by issuing the command "SIZE /big/file" inrEZLinux联盟
  # ASCII mode.rEZLinux联盟
  # These ASCII options are split into upload and download because you may wishrEZLinux联盟
  # to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),rEZLinux联盟
  # without the DoS risk of SIZE and ASCII downloads. ASCII mangling should berEZLinux联盟
  # on the client anyway..rEZLinux联盟
  #ascii_upload_enable=YESrEZLinux联盟
  #ascii_download_enable=YESrEZLinux联盟
  #rEZLinux联盟
  # You may fully customise the login banner string:rEZLinux联盟
  #ftpd_banner=Welcome to blah FTP service.rEZLinux联盟
  #rEZLinux联盟
  # You may specify a file of disallowed anonymous e-mail addresses. ApparentlyrEZLinux联盟
  # useful for combatting certain DoS attacks.rEZLinux联盟
  #deny_email_enable=YESrEZLinux联盟
  # (default follows)rEZLinux联盟
  #banned_email_file=/etc/vsftpd.banned_emailsrEZLinux联盟
  #rEZLinux联盟
  # You may specify an explicit list of local users to chroot() to their homerEZLinux联盟
  # directory. If chroot_local_user is YES, then this list becomes a list ofrEZLinux联盟
  # users to NOT chroot().rEZLinux联盟
  #chroot_list_enable=YESrEZLinux联盟
  # (default follows)rEZLinux联盟
  #chroot_list_file=/etc/vsftpd.chroot_listrEZLinux联盟
  #rEZLinux联盟
  # You may activate the "-R" option to the builtin ls. This is disabled byrEZLinux联盟
  # default to avoid remote users being able to cause excessive I/O on largerEZLinux联盟
  # sites. However, some broken FTP clients such as "ncftp" and "mirror" assumerEZLinux联盟
  # the presence of the "-R" option, so there is a strong case for enabling it.rEZLinux联盟
  #ls_recurse_enable=YESrEZLinux联盟
  rEZLinux联盟
  pam_service_name=vsftpdrEZLinux联盟
  userlist_enable=YESrEZLinux联盟
  #enable for standalone moderEZLinux联盟
  listen=YESrEZLinux联盟
  tcp_wrappers=YESrEZLinux联盟
  rEZLinux联盟
  2]更改完配制文件后,我们可以用下面的命令来重启vsFTPd服务器rEZLinux联盟
  rEZLinux联盟
  [root@linuxsir001 root]# /etc/init.d/vsftpd restartrEZLinux联盟
  关闭 vsftpd: [ 确定 ]rEZLinux联盟
  为 vsftpd 启动 vsftpd: [ 确定 ]rEZLinux联盟
  [root@linuxsir001 root]#rEZLinux联盟
  rEZLinux联盟
  3]以匿名方式来访问测试,在text模式下:rEZLinux联盟
  rEZLinux联盟
  注意:在text模式下,要用用户名ftp,密码ftp来访问,这才是在text中匿名访问FTP。看如下的操作:rEZLinux联盟
  rEZLinux联盟
  [root@linuxsir001 root]# ftp 192.168.0.1rEZLinux联盟
  Connected to 192.168.0.1.rEZLinux联盟
  220 (vsFTPd 1.1.3)rEZLinux联盟
  530 Please login with USER and PASS.rEZLinux联盟
  530 Please login

Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·无错版Vsftpd+Mysql+Pam配置虚拟用户方法  (2007-08-12 11:02:36)
 ·针对Linux系统网络服务器的一次渗透测试  (2007-07-04 11:40:07)
 ·vsftpd的几个有用配置  (2007-06-14 12:09:56)
 ·用VSFTPD搭建FTP服务器  (2007-05-30 10:37:01)
 ·Ubuntu Linux上安装SSH和Vsftpd的方法  (2007-05-30 10:08:45)
 ·vsFTPd的服务器和防火墙及SELINUX的关系  (2007-05-28 11:57:04)
 ·Linux系统的网络服务器配置详细解析  (2007-04-23 12:36:39)
 ·vsftpd配置参数详细整理  (2007-04-16 09:41:00)
 ·VSFTPD服务器架设菜鸟手记  (2007-02-19 13:39:54)
 ·Linux网络服务器配置基础  (2006-11-08 11:06:03)