[Samba] separate config for dedicate user

Rowland Penny rowlandpenny at googlemail.com
Tue May 5 08:29:42 MDT 2015


On 17/04/15 09:34, Meike Stone wrote:
> Hello,
>
> I run samba 3.6 and I need to track problems for dedicated users.
> So I thought, I load at the end via include special configurations for
> the user separately.
>
> My question is, how does the smbd configure itself. Does smbd
> 1) reads the config completely and then it set the parameters in the process or
> 2) does smbd reads and set each parameter instantly?
>
> So can I use the following example?
>
> Example:
> /etc/samba/smb.conf
> =======================================================
> [global]
> .
> .
>
>          vfs objects = extd_audit
>          debug uid = yes
>          debug pid = yes
>          debug class = yes
>          log level = 0 vfs:2
>          syslog = 0
>          max log size = 1024
>          log file = /var/log/smbduserlogs/%U.log
>          include = /etc/samba/debug/smb.conf.%U
>
>
> [share1]
>          path = /data/users/%U
>          writeable = yes
>          browseable = no
> .
> .
>
> [share2]
> .
> .
>
>
> [share-n]
> .
> .
>
>
> include = /etc/samba/debug/smb.conf.priv.%U
> =======================================================
>
>
>
> Example config for a dedicated user
> /etc/samba/debug/smb.conf.priv.smith
> =======================================================
> [global]
>
> vfs objects = extd_audit full_audit
> log level = 6 auth:10 passdb:10 vfs:3
> max log size = 102400
>
> [share1]
>          path = /data/users/%U
>          writeable = yes
>          browseable = no
>          .
>          .
>          full_audit:prefix = %u|%I|%m|%s
>          full_audit:success = open read pwrite unlink mkdir rmdir rename
>          full_audit:success = all
>          full_audit:failure = all
>          full_audit:facility = LOCAL7
>          full_audit:priority = ALERT
> =======================================================
>
>
> Thanks for help!!
>
> Meike

Hi, have you considered the 'config file' option ?
With this, you can created different smb.conf files and start the main 
smb.conf with:

[global]
           config file = /etc/samba/debug/smb.conf.priv.%U
            ..........

If the file exists it will be used when the user connects, otherwise it 
will be ignored and the rest of the smb.conf used.

Rowland


More information about the samba mailing list