Starting with VFS

From Wzdftpd

Jump to: navigation, search

Contents


Info icon
Known bug: the current stable version (0.7.2) does not show VFS entries when using MLSD to list directories. Just disable MLSD in your FTP client as a workaround.

Virtual FileSystem

A Virtual FileSystem (VFS) is a directory that exists only in the FTP server, not on your hard disk drive. This is mainly used when you have several partitions (or logical drives) and you want to make them appear as if they were subdirectories of your homedir.

For ex, we want to have that:

homedir: /              (located at c:\Program Files\wzdftpd\ftproot)
         |->  /dir1     (physical drive: m:\files)
         |->  /dir2     (physical drive c:\temp)
         |->  /file1    (real file)

First VFS

After the installation, this is what we have:

homedir: /              (located at c:\Program Files\wzdftpd\ftproot)
         |->  /file1    (real file)

To create the first directory, we use the followinf in wzd.cfg

vfs = |C:/Program Files/wzdftpd/ftproot/dir1|m:\files|

(Assuming the home directory of the testing user is c:\Program Files\wzdftpd\ftproot)

After restarting the server, we now have:

homedir: /              (located at c:\Program Files\wzdftpd\ftproot)
         |->  /dir1     (physical drive: m:\files)
         |->  /file1    (real file)

Using the same method, the second VFS is created using:

vfs2 = |C:/Program Files/wzdftpd/ftproot/dir2|c:\temp|

Using variables

Now, imagine we have several users with different home directories and with want all of them of have a directory dir1. We could, of course, add one VFS per user but there is a better solution: use a variable to automatically get the home directory of the user.

We can replace the previous line

vfs = |C:/Program Files/wzdftpd/ftproot/dir1|m:\files|

with:

vfs = |%userhome/dir1|m:\files|

Permissions

Now, imagine we want only administrators (siteops) to be able to see (and use) the previous VFS:

vfs = |%userhome/dir1|m:\files|

We have to restrict it. This is done by adding permissions to the configuration line, for ex. to restrict this VFS to people having the O flag (siteop) set:

vfs = |%userhome/dir1|m:\files| +O

To restrict it to the members of the admin group:

vfs = |%userhome/dir1|m:\files| -admin

And to combine permissions, just separate them with spaces. For ex, to allow members of the admin group and user joe, use:

vfs = |%userhome/dir1|m:\files| -admin =joe

Note: signs +, - and = are not used to add or remove users, but to precise the kind of object (and differentiate them).

Online Commands

The commande site vfsls lists all VFS and associated permissions:

| C:/Program Files/wzdftpd/ftp| h:/                         | not restricted |

(The physical part is truncated)


The commande site vfsadd adds VFS and associated permissions:

site vfsadd |/home/vfsroot|/physical/path| [PERM]

(The physical part is truncated)

Personal tools
documentation