[Samba] What is the difference between %S, %u and %U variables in sbm.comf

Chris Weiss cweiss at gmail.com
Fri Nov 2 07:56:34 MDT 2012

On Fri, Nov 2, 2012 at 8:00 AM, Dmitrijs Demidovs
<dmitrijs.demidovs at datakom.lv> wrote:
> Hi list,
> Can someone please clarify the difference between variables %S %U %u in smb.conf?
> It is not clearly defined in man smb.conf page (at least for me)
> %u - username of the current service, if any.
I think this would be the unix user account the smbd process is
running as.  it isn't the same as the username they login as in all

> %U - session username (the username that the client wanted, not necessarily the same as the one they got).
this would be the name they logged in as.  In some cases this can be
the machine account name too

> %S - the name of the current service, if any.
this is typically the share name.  it can be IPC too, but unlikely
you'd ever use it in a context where you'd see that

More information about the samba mailing list