The mount command in Linux is used to attach a file system to a certain device. One of the least used features within mount is called bind. With bind, you can mount a certain directory to another directory within the file system. The result is, the files are accessible from both directories. This feature is particularly helpful when sharing files. I use it to map the home directory of a FTP user to the home directory of the web server. In this particular example, I’m using a FTP user called ‘ftpuser’ and mapping the drive to ‘/var/www,’ which is Apache’s home directory.
Mount Bind Command
mount --bind /var/www /home/ftpuser |
Make It Permanent
To make this mount permanent, you need to add it to /etc/fstab.
/var/www /home/ftpuser bind defaults,bind 0 0 |