FTP with 3 USB harddrives formatted ext4

FTP with 3 USB harddrives formatted ext4

Postby lintner » Thu Oct 22, 2015 8:04 am

I have allready a lacie cloudbox with your excellent firmware up and running, but I wanted to try it on the pi, so I dusted off my rasperry pi 1 B+, and ordered a 16 GB SD CARD, and installed, and wow, what an easy install that was, great work guys !

But now I have some questions ... I read somewhere that you can expand the filesystem on the SD so that it uses the whole SD, how would I do that ?

and then on to the ftp problem ...

I have 3 USB Harddrives, 4 TB formatted ext 4, and they are mounted fine, can see them as 2000, 2001 & 2002 ...

but now, the only way to set up a ftp where all 3 harddrives are available is if I set the home directory to / (share directory), and what I see then is folders 1000, 2000, 2001 & 2002, and though that obviously works, I was wondering if there is another way to do it, where I make a home directory on one of the usb drives, so that I can jail all users there, but that they can see the 3 harddrives, and just their names, like they show up in SAMBA (the 3 drives are named, Movies, TV & Download) ?
lintner
 
Posts: 4
Joined: Sun Apr 19, 2015 8:48 pm

Re: FTP with 3 USB harddrives formatted ext4

Postby Jocko » Thu Oct 22, 2015 2:48 pm

Hi lintner,

proftpd handles only real folder path and not virtual folder name. So there is no way to change 2000, 2001, 2002 by the label disk.

But you can use this workaround:
- create on 1000 a share (I assume you will name ftp), with the wanted permissions for the ftp users
- jail the ftp users in this share (set /share/1000/ftp as their home directory and select the option "Jail all FtpUsers in their Home Directory"
- Create 3 subfolders in /share/1000/ftp : Movies; TV; Download. You can create the folder from your laptop or from a shell terminal but in this case set full permissions (777) on them
- do a bind mount with your 3 disks on these folders
Code: Select all
mount --bind /share/2000 /share/1000/ftp/Movies
(if the mounted disk on 2000 is your movies disk)
repeat for the two other disks.

So after login, the FTP users will be chrooted in the ftp share and will see the 3 folders named as your disk labels.

Note: if you set full access for these ftp account, the users may still write to the ftp share (so to the SD card)and not only to the usb disks.

If you want to restore the bind mount after rebooting, you may create a boot job
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France


Return to Raspberry Pi 1, 2, 3 and 4

Who is online

Users browsing this forum: No registered users and 1 guest

cron