FTP One account multiple home directory solution

Source: Internet
Author: User

In general, when configuring FTP, an FTP account only corresponds to a home directory and cannot have multiple home directories.

However, according to the needs of the company's development projects, we need to do an FTP corresponding to multiple development directories. Have thought of creating a soft link, but found that through FTP is not accessible.

To illustrate:

The/HOME/WWW directory structure is:

/home/www/Project1project2project3├──test└──wordpress

There are three project directories: Project1,project2,project3.

Need to configure the development of an FTP account, through the account login, only see three items directory,/home/www under the other directory is invisible.

Difficulty: If the home directory of the FTP account is set to/home/www, it can be seen in addition to the other directories of the three project directories, which do not meet the requirements. If you have an FTP home directory for each project directory, you will need to create three FTP accounts that do not meet the requirements.

Solution:

Mount the map using mount.

mkdir /home/ftp/{project1,project2,project3}-/bin/Mount --bind/home/www/ project1//home/ftp/project1//bin/Mount --bind/home/www/project2//home/ftp/ project2//bin/Mount --bind/home/www/project3//home/ftp/project3/

Use the/home/ftp directory as the home directory for FTP, log in, and only three project directories will appear. Effect achieved.

Add the above three mount commands to the/etc/rc.local file to enable automatic mount on boot.

FTP One account multiple home directory solution

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.