服务器

位置:IT落伍者 >> 服务器 >> 浏览文章

vsftpd-1.1.3配制实例之四:VIRTUAL


发布日期:2020年04月18日
 
vsftpd-1.1.3配制实例之四:VIRTUAL

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>

               

上一篇:建立数据库认证的FTP

下一篇:建立与Oracle服务器连接的两种连接模式