[Samba] Auto mounting NT shared Home Directories

Buchan Milne bgmilne at cae.co.za
Mon Apr 15 09:06:03 GMT 2002

> Message: 15
> Date: Sat, 13 Apr 2002 11:02:23 +0200 (CEST)
> From: Urban Widmark <urban at teststation.com>
> To: Rob Keeling <rob at rjkeeling.freeserve.co.uk>
> Cc: <samba at lists.samba.org>
> Subject: Re: [Samba] Auto mounting NT shared Home Directories
> On Fri, 12 Apr 2002, Rob Keeling wrote:
>> I have set up samba 2.2.3a with winbind to join SuSE linux 7.3 machines
>> into our NT 4 domain, but would like to be able to set up Linux thin client machines
>> to allow transparent use of either windows or Linux desktops. To accheve this I need
>> to be able to access our Home directory shares from both systems, the best way for
>> us to go at the moment is to find a way of getting linux to automount the users home 
>> directory on logon. All our users have a share on one of three NT servers which coresponds
>> to their username. What I would like to do is find some way of on logon /home/(whatever) is
>> mapped to a smb share of //server/(whatever)$. as we have 1200 user accounts setting this
>> up needs to be rule based!
> autofs has executable maps where it runs a program when you try to access
> something. So you could write a script to determine what to mount.
> pam_mount could also be an option.

IMHO, pam_mount would be the better solution, as it uses the 
username/pass given to pam, which, if you are using winbind via pam, 
means the domain account and password.

I have tried to get this working, but the problem is that winbind 
provides the username as "DOMAIN+username" (depending on winbind 
seperator), but currently pam_mount can only use a wildcard for the 
username in the directory to mount. Thus, you have problems when you 
want to mount a share as the home directory windbind uses (/home/%D/%U), 
since you would specify:

/home/DOMAIN/%U, but that ends you up with:


pam_mount needs to either support a wildcard representing the users home 
directory (~ might be a good one), or it needs to have an option for 
mounting relative to the users home for shares mounting to a path not 
prepended by a /.

I was working on a patch for this a while back, but my code has some 
bugs (segfault).

This feature would be useful in non-winbind setups also, so it might be 
worthwhile adding to pam_mount.

Of course, if you only have one domain, you could use pam_mount with 
winbind from samba-3.0alpha with the default domain parameter.


|----------------Registered Linux User #182071-----------------|
Buchan Milne                Mechanical Engineer, Network Manager
Cellphone * Work            +27 82 472 2231 * +27 21 8828820x202
Stellenbosch Automotive Engineering         http://www.cae.co.za
GPG Key                   http://ranger.dnsalias.com/bgmilne.asc

More information about the samba mailing list