Monday, April 4, 2016

ftp - Permanent mount and bind on CentOS?



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?


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

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...