Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I tried making a VSFTPD user with access to all of our clients' FTP folders. (the users are all chroot'ed to their home directories, where the public_html folders are).

What I did was create a new FTP user and created a client directory inside /home/global_user/. Then I used the following command to mount the client's user directory into the global user directory, like this:

mount --bind /home/global_user/client_directory /home/client/

What happened next is that indeed the folder was mounted, but all the files in the original folder are gone! They don't appear in the new mount either.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

mount --bind olddir newdir

So after running

mount --bind /home/global_user/client_directory /home/client/

the original contents (none) of /home/global_user/client_directory are also available in /home/client/. You can't see the original contents of /home/client because you overlayed your new empty directory on top!

Just umount this, and try again with the arguments reversed.

share|improve this answer
    
Thank for your reply my friend. I tried to umount both folders, and I get "device is busy" for both directories, even when sudoing it. –  pilau Feb 20 '12 at 14:41
    
That means some process is touching the mount target (/home/client) - make sure no shell is in there and try again (lsof +D /home/client may help). Oh, and you're only trying to umount /home/client. –  Useless Feb 20 '12 at 14:48
    
I figured it out - umount -l /home/client/ did the trick :) Thank you for your help. –  pilau Feb 20 '12 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.