Hi,
I want to auto-mount directories in CIFS shares from a
Windows 2003 Server whenever a user logs in on a linux
computer. In pam_mount.conf this looks like:
volume '@Mitarbeiter' cifs fileserver.domain H_Staff/&
/home/DOMAIN/&/files - - -
This does _not_ work, because mount.cifs can only
mount shares, not directories in shares (H_Staff alone
works, but is not what I need - all home directories
are in the H_Staff share and I cannot make every
directory a share). Other people seem to have the same
problem: http://www.linuxquestions.org/questions/
showthread.php?p=2124397#post2124397.
A quick hack could be divide mounting (CIFS and SMBFS)
into two steps. First mount the share, then re-mount
the directory in the share with 'mount --bind ~/files/
$user ~files'.
Alternatively you could add functionality like
mntagain to the config file (e.g. 'mntagain ~/dings/%
(USER) ~/dings'). As far as I understand the pam_mount
source code, 'mntagain' is only available internally,
not as option in pam_mount.conf.
I am sure many admins battling Windows domains will
appreciate such a feature. I for one would.
Unfortunately I don't have time / skills / a working
devel environment at hand. However, I could do some
kind of graphic design/multimedia work in exchange for
a quick solution :-) (or a hint how to solve this
problem myself)
Thanks,
Raphael Wimmer
LFE Media Informatics
University of Munich
wimmer@informatik.uni-muenchen.de
Logged In: YES
user_id=1287009
This should better be done at the kernel (fs) level.
Logged In: YES
user_id=1287009
There's an (untested) workaround, add this to your
pam_mount.conf:
volume @Mitarbeiter mycifs - & /home/DOMAIN/&/files - - -
And create a script /sbin/mount.mycifs that does extract the
arguments and mounts the H_staff share and binds it to the
user directory - below pam_mount.
Logged In: YES
user_id=1287009
This would be a good candidate to mention to the linux kernel mailing list (as
a feature request) to cifs. Write to linux-kernel@vger.kernel.org, Cc
sfrench@samba.org, linux-cifs-client@lists.samba.org and me.