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