Announce: experimental PAM module to mount SMB/NCP modules at login time

Urban Widmark urban at
Thu Jul 27 22:22:45 GMT 2000

On Thu, 27 Jul 2000, Elvis Pfutzenreuter wrote:

> This PAM module can use the password that user has just typed. 
> Several people asked me about some thing like this, to mount remote NT 
> volumes @ login (and unmount them over logout, of course). I didn't found any 
> other module or program that did the thing this way (i.e. without kepping 
> passwords in some file etc.), so I wrote one.

Cool. How do I use it? A short description of what goes where would be
nice for pam newbies like myself. You'll probably get more testers if they
don't have to browse the source to find out how to set it up.

> It is a 0.0.1 (alpha) release, and module still has a lot of debug printf()s, 
> but it seems to work well. I expect to collect wishes and ideas to improve 
> the module. It can be found at

Call them ncpfs & smbfs instead of ncp & smb, or accept both names. I know
some people have strong feelings about the 'fs' bit and it's probably more
(Nah, personally I don't really care, call them X and Y :)

                ntype = strcasecmp(type, "smb") == 0 ? SMB : ntype;
                ntype = strcasecmp(type, "ncp") == 0 ? SMB : ntype;
looks funny, shouldn't that be NCP in the second line?

Is there a reason for not using the 'mount -t smbfs' format and instead
call smbmount directly (with a fixed path)? When installing samba from the
tarball a symlink is made that should make mount -t find smbmount but
smbmount is not put in a "normal" path.

How do I pass options to the mountprogram? Maybe you could allow entries
in /etc/fstab too. "grep" the ones with the right fs and a matching
username=... parameter, add password=... and take the rest of the options
from the fstab line and pass that to the mount command.

This allows sharing entries between pam-mounted and normally mounted. For
smbfs (not sure about ncpfs) and maybe of limited use since most people
don't want to put passwords in /etc/fstab ... (You can do 'mount /mnt/smb'
with a fstab entry, but it needs to get the password from somewhere. And
the password prompt doesn't seem to work when using mount).

This only handles mounting stuff on login. How does it get the
username&password? Does it assume you are using the same locally as you
are on the server? (probably a common case).


More information about the samba-technical mailing list