Forum archive
File Server - Template Structure
Hi Folks,
Just wondering if it is possible to create a template folder structure for each users home share.
Effectively when I add a user, a template folder structure will automatically build itself.
Example:
-user1
-folder1
-folder2
-------------------------
-user2
-folder1
-folder2
Any help would be great, cheers!
Assuming that you use the fileserver appliance in it's default "stand alone" configuration, then Samba (i.e. Windows) users are mapped to Linux users. And Linux has a cool feature when the directories and files which appear in /etc/skel will be added to any newly created user accounts. So in that scenario, it'd be super simple. Just create your desired structure in /etc/skel and it'll get auto applied whenever you create a new user. TBH, I haven't tested it with empty directories, but I'd assuming that it'd work the same.
If you have your fileserver as a Windows AD domain member, then it's not quite so easy, as all the individual Samba/Windows users, actually run under a single Linux user account. Because of the nature of Linux, I'm certain that you could script something to create the required file structure when required, but TBH, how you would trigger that, I'm not so sure.
If you're in the second category, then it might be worth asking on one of the stack exchange sites, or on the Samba mailing list.
Please post and let me know how it goes.