熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

vsftpd-1.1.3配制實例之四:VIRTUAL

2022-06-13   來源: Oracle 

  This example shows how you might set up virtual hosts Virtual hosting is
  where different clients access your machine on different IP addresses (virtual
  IPs) and get redirected to different ftp sites
  For example if your machine responds to two IPs and
  you could have the two different IPs represent two totally different FTP sites
  For this example we are going to build on the INTERNET_SITE example
  Step ) Set up a virtual IP address
  ifconfig eth: up
  (the standard IP address is )
  (note this isnt quite complete the route for local connects hasnt been
  added but it will do for now)
  Step ) Create a user / location for the new virtual site
  useradd d /var/ftp_site ftp_site
  chown rootroot /var/ftp_site
  chmod a+rx /var/ftp_site
  umask
  mkdir /var/ftp_site/pub
  echo test > /var/ftp_site/pub/content
  Step ) Modify the existing site to respond to the primary IP
  Edit /etc/xinetdd/vsftpd and add the config line:
  bind =
  Step ) Create the new site responding on the virtual IP
  cp /etc/xinetdd/vsftpd /etc/xinetdd/vsftpd
  Edit vsftpd and change
   The bind line to refer to the IP address
   Add the line
  server_args = /etc/nf
  This launches this FTP site with a different vsftpd configuration file
  cp /etc/nf /etc/nf
  Add two lines:
  ftp_username=ftp_site
  ftpd_banner=This is the alternative FTP site
  Step ) Restart xinetd and test!
  /etc/rcd/initd/xinetd restart
  [chris@localhost vsftpd]$ ftp
  Connected to ()
   ready dude (vsFTPd : beat me break me)
  Name (:chris): [chris@localhost vsftpd]$
  [chris@localhost vsftpd]$ ftp
  Connected to ()
   ready dude (vsFTPd : beat me break me)
  Name (:chris):
   This FTP server is anonymous only
  Login failed
  ftp> quit
   Goodbye
  [chris@localhost vsftpd]$ ftp
  Connected to ()
   This is the alternative FTP site
  Name (:chris):
   This FTP server is anonymous only
  Login failed
  ftp>

From:http://tw.wingwit.com/Article/program/Oracle/201311/18549.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.