I need help with Samba
configuration.
What I want to achieve is configuration, where windows user on share see only his files. This is simply achived With configuration like this:
Users are authorized by Windows AD Server
[BACKUP]
comment = BACKUP STORAGE LOCATION
path = /storage/BACKUP
read only = no
browseable = yes
writable = yes
create mode = 0600
directory mode = 0700
force directory mode = 0700
force create mode = 0600
access based share enum = yes
hide unreadable = yes
valid users = "@DOMAINNAME+SOMEUSERGROUP"
It works ok but...
On the server side, everything in directory /storage/BACKUP
keeps files of every user.
So I would like to create directory here for every user (I Can't use [home], because it's already used)
So i Would like to keep it like this:
/storage/BACKUP/username/
So when i change path, and add %U
at end, everything is almost ok.
The problem is that i need to manually create directory /storage/BACKUP/username
.
So what i need is somehow force Samba
to create this directory before user to access this share.
I've tried adding add user script = /path/to/mkdir /storage/BACKUP/%U
But this is not working because:
- I don't know why ;)
- I've already have users logged in before
- It should start for new created users, this will be ok for me, but it not works.
I'm not creating users in linux, after they login, so i'm not using add user/machine script anywhere else.
So i want to force Samba
to create directory for user, when this user tries to connect.
I'm searching google from couple of hours, and didn't find a way to do it that will work for me.
I need to keep /server/BACKUP location for everyone, but on the server side, Need to keep files in separated directories per user, so creating a new share is also not a solution.