Virtual Host-Based FTP Configuration

Source: Internet
Author: User

Apache has a virtual host that allows users to enter different URLs to access different pages,
In fact, ftp can achieve the same effect, but in the implementation process, the methods used are different;
The topology is as follows:
C (192.168.1.0/24) ------- FTP --------- c (192.168.0.0/24)
To make the access results of users in two CIDR blocks different, perform the following operations:
# Useradd-d/var/ftp2-s/sbin/nologin ftp2
# Chmod-R 755/var/ftp2
# Chown-R root: root/var/ftp2
# Mkdir-m 755/var/ftp2/pub
# Chown ftp2.root/var/ftp2/pub
# Cp/etc/vsftpd. cof/etc/vsftpd. vsftpd1.conf
# Vim/etc/vsftpd. conf
Listen_address = 192.168.1.103
# Vim/etc/vsftpd/vsftpd1.conf
Listen_address = 192.168.0.103
Ftp_username = ftp2
Local_root =/var/ftp2
# Service vsftpd restart
Verification:
# Setenforce 0 // disable selinux
# Lftp-u ftp 192.168.1.103
# Lftp-u ftp2 192.168.0.103
If you do not disable selinux
You can use the following method to set the settings to achieve the same effect.
# Chcon -- reference =/var/ftp/var/ftp2
 
You can use the following command to set it.
# Setsepool ftp_home_dir = on
In this way, you can add multiple ftp sites as needed based on your network deployment.
Author: "IT dream-qi-sharing"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.