Score:1

FTP server for content distribution

mn flag

I need to set up an FTP server for distributing various versions of a software package to a number of user accounts.

To avoid copying the files to each user's ftp home folder, I would like to set up a 'shared file environment' with symlinks using a structure much like this :

/
...
+-- srv
    +-- ftp
        +-- data
            +-- V1
                +-- Latest            -> /srv/ftp/data/V1/V1.3
                +-- V1.1
                +-- V1.2
                +-- V1.3
            +-- V2
                +-- Latest            -> /srv/ftp/data/V2/V2.2
                +-- V2.1
                +-- V2.2
            +-- V3
                +-- Latest            -> /srv/ftp/data/V3/V3.1
                +-- V3.1
        +-- users
            +-- user1
                +-- V3                -> /srv/ftp/data/V3/Latest
            +-- user2
                +-- V2                -> /srv/ftp/data/V2/Latest
            +-- user3

Each version is a folder with several files and subfolders.

I'm using a linux box (CentOS 7) with vsftpd; my problem comes when I try to limit user access to his home folder; the server will not allow following the link outside the user's folder.

For instance, I would like user1 to see only the V3 folder and its content (with sub-folders)

So the questions is : is this the right approach ? if yes, how to get it to work, if not, what would be the recommended approach for something like this ?

vidarlo avatar
ar flag
Why would you want ftp over e.g. http or sftp?
stefanu avatar
mn flag
thank you for the suggestion, but that's not the point of the question
Score:1
in flag

As a general consideration: stop using the legacy FTP protocol for content distribution.


As an alternative to using symbolic links you can use a "bind" mount to replicate part of your file system elsewhere, for example in a users personal directory hierarchy. Bind mounts shouldn't interfere with chroot confinement strategies.

The following syntax is equivalent:

mount --bind /srv/ftp/data/V3/Latest /srv/ftp/users/user1/V3
mount -o bind srv/ftp/data/V2/Latest /srv/ftp//users/user2/V2

Create the associated entries in /etc/fstab to make that persistent across reboots.

stefanu avatar
mn flag
thank you. it's exactly what I needed
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.