So I got everything to work like I would like, I think.
Haven’t been able to set the permissions right on my ext4 but got it to work with ntfs by adding ‘permissions’ in the fstab file. My other drive that was unmounting itself is something I haven’t figured out yet. When mounted on my Windows computer and run chkdsk I have always one error, also a popup with the same error when I open any map on my hard drive, that my recycle bin has been corrupted, have been looking for a solution quite some time but more and more I’m afraid that the disk is physically broken.
So that’s working fine now
Then there was my ftp problem (which started this thread originally).
Since I have 2 devices now, I have one device that has mounted my hard drive and has all my download programs installed together with openvpn and my other one with kodi and vsftpd, which gave me a lot of trial and error to get the right maps shared with the right permissions.
Because I want to share a few maps with some friends and family, I have to use chroot, which makes that every user can only get in his usermap (/home/user). So I had to start looking for a solution to make my mounted hard drive (in my case a mounted network share but about that more later) accessible to my users. First I tried shortcuts but that didn’t work because chroot won’t let you get out of your usermap. So how did I fix it?
So of course you have to enable chroot in your vsftpd configuration file, I also had to add ‘allow_writeable_chroot=YES’ to the file to have it work. So the work around for it is to access the maps is using bind mounts.
For example:
First you have to make a map in your user folder:
Code:
mkdir /home/pi/Media
Then you have to “mount” your mounted hard drive (or a folder in it) to your just made folder.
Code:
mount --bind /mnt/Media /home/pi/Media
You will see if you open /home/pi/Media that everything will be accessible there.
This is only temporary, if you want the mount to stay you have to add it to your fstab file:
Code:
/mnt/Media /home/pi/Media none nofail,bind 0 0
Reboot and you will see the map is automounted.
You can add as many folders you like to a user and all mount them with different folders.
So then we come to my last problem, because I wanted one map where people can upload files to and the rest of my maps had to be read only. Because I use mounted network shares I found the solution in the samba shares on my other device, there my shared folder has permissions 755 and 644, so only pi could write to it. I had to add an extra share to my samba file with both permissions 775 and on my ftp device, in the vsftpd file, enable umask and set to 000 (because the files has it’s permissions set by the samba rules). And now I was finally able to add files to this one map as any user in the group pi.
And now after lots of looking, searching, asking for help,.... I finally got everything set up the way I want. I hope...
I hope it’s all a bit clear.