LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-20-2009, 07:42 AM   #1
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Rep: Reputation: 30
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.
 
Old 04-20-2009, 09:39 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,007
Blog Entries: 5

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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...).
 
Old 04-20-2009, 10:38 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
Old 04-20-2009, 11:11 AM   #4
mohtasham1983
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: Reputation: 30
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.
 
Old 04-20-2009, 01:52 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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.
 
  


Reply

Tags
mount, vsftpd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click on Places>Search for Files> (I get a Nautilus has quit error) Balarabay1 Suse/Novell 0 07-14-2006 08:44 AM
mandrake 10.1 sharing files and internet sharing xfiles_arram Linux - Networking 0 05-21-2005 02:22 PM
Where Files Are Places easyex Linux - Newbie 0 03-21-2004 01:35 AM
samba/Can't see Linux files in XP Network Places RogueWave Linux - Networking 1 01-24-2004 05:23 PM
samba/Can't see Linux files in XP Network Places RogueWave Linux - Security 2 01-24-2004 04:59 PM


All times are GMT -5. The time now is 01:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration