Centos – Permanent mount and bind on CentOS

centosftp

I have set up a CentOS 6.2 VirtualBox along with FTP and Apache root of /var/www/html/.

By default, the user ftp account is set to /home/user_name/.

However, I'm guessing it's common practice to give that user access to the /var/www/html/.

I was able to mount and bind the directory to the user directory as such:

mkdir /home/ftp_user/html/
mount --bind /var/www/html/ /home/ftp_user/html/

But as soon as I shut down my VirtualBox, this bind disappears.

Is there any way to make this permanent?

Best Answer

Sure - put the bind mount in your /etc/fstab. Device is your source directory, mount point is your mount point, and the type is 'bind'.

Something like this:

/var/www/html/ /home/ftp_user/html/ bind rw,bind 0 0
Related Topic