[Samba] difference between '%u' and '%U'?

TAKAHASHI Motonobu monyo at monyo.com
Sat Aug 13 00:40:58 MDT 2011

From: Michael Wood <esiotrot at gmail.com>
Date: Thu, 11 Aug 2011 13:24:12 +0200

> On 11 August 2011 06:50, Linda Walsh <samba at tlinx.org> wrote:
> > .... well I just don't understand what the
> > differences are between them.
> >
> > Sure I can read the smb.conf page:
> > %U
> >  session username (the username that the client wanted, not
> >  necessarily the same as the one they got).
> > vs.
> > %u
> >  username of the current service, if any.
> > ---
> I must say those descriptions don't tell me what the difference is
> between them.  The parenthetical note for %U hints that perhaps with
> an unacceptable username (e.g. very long, like David says) would get
> mangled in which case I would guess %U is the full username and %u is
> the mangled one.  But that's just a guess.  It would be nice if the
> documentation were more explicit.

%U is an username used at authentication.

%u is an username used to access the files actually.

For example, if you set 

  force user = share-user

in a share, and access the share with a-user, then 

%U will be "a-user".
%u will be "share-user".

> > But my 'home' is always set to  /home/Domain/User,
> > but my profile (under W7), is stored under /home/Domain/User.V2...
> I believe the ".V2" has nothing to do with %U or %u, but is just
> something newer versions of Windows (from Vista?) tack on to the
> profile name because the newer profiles are not compatible with older
> (e.g. XP) profiles.

Unless you use "smbpasswd" as passdb backend, "logon home", "logon
path" and such parameters only affect the default value of those, once 
these values are set, you have to modify with pdbedit or from Windows
per user.


> I must say those descriptions don't tell me what the difference is
> between them. 


TAKAHASHI Motonobu <monyo at samba.gr.jp>

More information about the samba mailing list