LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   FTP server to upload files on an external HDD (https://www.linuxquestions.org/questions/linux-server-73/ftp-server-to-upload-files-on-an-external-hdd-739018/)

manish_jain 07-09-2009 05:35 PM

FTP server to upload files on an external HDD
 
Hello,

I have set up a linux ftp server (vsftpd) with local_enable=YES and chroot_local_user=YES.

Also attached to the server is a 1TB backup drive, and all users have a backUpFolder on that drive.
Besides, all users have in their home directory: $$ ln -s /media/[BackUPDriveMnt]/[BackUpFolderForUser] myBackupFolder.

The intention is for the users to be able to specifically upload files to this backup drive. However, ftp disallows users to cd into this myBackupFolder.
scp into the folder works fine. ftp uploads to other local directories of the users also works.

One thing that I have observed is that these backup folders are owned by root/root with 777 permissions, but that is not surprising as external hdd's are mounted by root.

Can you tell me what is missing?

Thanks.

shane25119 07-09-2009 08:25 PM

In your FTP script why not put the users into the backup drive by default?

manish_jain 07-09-2009 08:55 PM

The idea was that users can access their personal accounts as well as the backup drive. If I put them in the backup drive by default, will they be still able to access their home directories?

btw, which trying mount --bind, I somehow screwed up my 1TB drive. It shows all the files present when I mount it, but
fdisk -l says 10MB, 100% usage and fsck says

fsck 1.41.3 (12-Oct-2008)
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb
/dev/sdb:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>


Man I am so stuck !! :(

suhas! 07-10-2009 09:09 AM

Hello,

Instead of creating a symlink to external drive in every user's home directory, you can just remount the same external drive under every user's home directory

# mount --make-shared /media/[BackUPDriveMnt] /home/user1/[BackUPDriveMnt]

Above command will allow you to have multiple mount point to the same drive, and ftp will also allow access to that drive.

If you have permissions properly set for /media/[BackUPDriveMnt]/[BackUpFolderForUser] , it should serve your need.

Regards.

manish_jain 07-10-2009 10:04 AM

Hi,

Thanks. I will try this today evening and let you whether it works or not.

bye
Manish


All times are GMT -5. The time now is 11:55 PM.