How to mount one folder in another (Giving access to external folder in jailed ftp/vsftpd)
Sometimes soft links are not enough, especially when you are setting up jailed ftp.
Suppose you have created a user who has permission to only see his home folder, still you want to give them access to /var/www/mvc_framework/views/
folder. How will you do that ?
This is where you will need to mount a folder inside another.
You can do that using--bind
parameter with mount
command.
So the command becomes mount --bind /path/to/old/directory /home/username/new/directory
Or you can also use -B
instead of --bind
But this is onetime command, if you restart your machine (server), mapping will be lost. To mount it every time machine is restarted, open /etc/fstab
and append/path/to/old/directory /home/username/new/directory none bind
Next time when you restart your server, it will be automatically mounted.