Search code examples
linuxsamba

"Virtual" Windows Shares (possibly) using Samba?


I am interested in developing an application that acts as a Windows computer exposing shares that do not exist physically. This means that directories and files may not exist as such in any file system.

The process should be like the following:

  1. Somebody attempts to connect to \\MyFakeSambaServer.
  2. User is prompted with the User & Password input fields.
  3. Server receives credentials and either denies or accepts request.
  4. If successful, a list of files and directories are shown. The shares shown and the contents of a specific path may be dependent on the path itself and the user that's accessing the data.
  5. It should be possible to handle both downloads and uploads.

Now, the actual question is: is there any way to integrate scripts onto Samba in order to achieve this?

I am aware of the amount of work that such a server could take if developed from scratch, so I am looking to make use of existing software that runs on Linux as much as possible.


Solution

  • This could be implemented atop Samba as a VFS module. Alternatively, a virtual file system could be exposed through Linux using FUSE and exported normally via Samba. Either way, you'll be confronted with the complexity of implementing a file system interface.