| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-20-2009, 07:42 AM
|
#1
|
|
Member
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408
Rep:
|
Sharing files from different places using vsftpd
Hi,
I have a lot of movies that I usually share with my roommates using my vsftpd server. The root directory of my Arch Linux machine is located at /srv/ftp/. I created a directory inside it and named it downloads. I set the permission to 740 on it. Then I used the following command to point my movies from my home directory to the ftp root directory:
PHP Code:
mount --bind /home/myname/movies/ /srv/ftp/downloads
So far so good. If I go to my ftp server, I can see all the movies over there. However, I'm only able to download those movies that are actually inside "movies" directory, not those which are there using symbolic links.
Because, I ran out of space on my home directory, I moved half of my movies to my windows partition (Which I don't use) and then created soft symbolic links from there to the movies" on my home directory. This way, when I browse my movies directory, I can see everything at once.
I was wondering if there's anyway, where I can share my movies on my ftp server, so that, all my movies appear in a single directory from user point of view, and all of them can be downloaded by users.
I would like to mention that, there's nothing wrong with the permissions of my movies on my NTFS directory, as when I mound them to /srv/ftp/download/ separately, I can download them without any problems.
Thanks in advance.
|
|
|
|
04-20-2009, 09:39 AM
|
#2
|
|
Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,644
|
When you share out something you're sharing out the filesystem to which the filesystem refers. From what you wrote it sounds as if the files you have symbolic links to are in a separate filesystem. Once the users mounts the filesystem remotely they have only the original filesystem and no view of any others. You could share out the other filesystem and have them mount both but even then for the symbolic links to work they'd have to be the same paths on the remote machine as on the local.
There's no real way to work around the separate filesystems issues.
The danger in sharing out your other filesystem is if it is root you're compromising your security.
The best idea would be to rework your filesystems so that all the space you need is in one filesystem. This might require reducing existing filesystem you are doing symbolic links to and expanding the one you're sharing out. If this filesystem is in fact root it becomes a bit complicated and I'd advise you to do a Google search for how to do it for your particular distro, raid type, LVM, partition and filesystem type (Reiser, ext3 etc...).
|
|
|
|
04-20-2009, 10:38 AM
|
#3
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
After you bound the /home/myname/movies directory on /srv/ftp/downloads, the /srv/ftp/downloads directory will have the permissions of the /home/myname/movies directory. You will want to change the permissions to what they would need to be for the ftp service.
Also, the users need read access to the documents as well as read/execute access to the directories for them to be able to read the files.
You might try creating symbolic links of all of the movies in the NTFS directory to the /srv/ftp/downloads directory.
ln -s /mnt/xp/path/to/directory/*.mpg /srv/ftp/movies/
You will need to change the permissions of the NTFS partition (using fmask & dmask in /etc/fstab) to allow users to download the movies there.
Check the permissons for others for /srv/ftp/downloads, and the files and directories in it. The permissons for the files on the NTFS partition will all be the same and determined at mount time.
|
|
|
|
04-20-2009, 11:11 AM
|
#4
|
|
Member
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408
Original Poster
Rep:
|
I guess the only way of pointing a directory to vsftpd root directory is using mount command with --bind or --rbind option. You cannot use symbolic links to point directories.
In my case, I have symbolic links pointing to my movies directories which is bound to /srv/ftp/.
I just added a symbolic link from a directory inside my home directory to my movies directory and the result was the same as my links from the NTFS partition. It means, files and directories that are inside my movies directory using symbolic links cannot be bound to /srv/ftp/. I just opened it using Opera, and it didn't show any type of symbolic links, while regular directories had a directory type.
I guess the best solution is to restructure the content of /srv/ftp by adding more directories and dividing my movies by category and mound every category one by one.
|
|
|
|
04-20-2009, 01:52 PM
|
#5
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Sorry, I guess I didn't actually test downloading one of the Vista file links.
sudo mount --bind Documents /srv/ftp/documents
ln -s /mnt/vista/Boot/* /srv/ftp/documents/
Logging in from another computer, both the files in Documents and from my Vista partition were in the documents directory. The filesystem the links pointed to weren't accessible. Binding /mnt/vista/Boot to /srv/ftp/vistaboot, I was able to download files from /srv/ftp/vistaboot.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:19 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|