Hello all-
First of all, I hope this is the right venue for this question, but I guess it could also go to the networking (net share aspect) or security (pam aspect) forums. Hope I picked the right one. Anyway- the question:
How can I get pam_mount to automatically mount a user specific share upon their logging in to a Linux machine? I've got a static case working, but I don't want to have to pre-configure every user on my network an all the machines they could possibly log on, I'd rather have it be done automatically. In Windows we provide our users with an "H:" drive which is a share on a windows server named the same as their login name. So, when user FooBar logs in to the network on a 2K machine, he gets an automatic mount to \\fileserver\FooBar. That's what I want pam_mount to do and here's what I've tried so far:
-I've got AD authentication through winbind working just fine with the following login format: DOMAIN-username
-I've got the home directories auto-creating just fine with pam_mkhomedir
-I've configured pam_mount's luserconf setting to use
~/.pam_mount.conf
-I've got a line in the /etc/skel/.pam_mount folder that reads
volume user smb FileServer % /home/%D/%U/H nosuid,nodev,workgroup=DOMAIN - -
-I've got a line in
~/.pam_mount.conf that tries to use env. variables
I believe my problem is with the way pam_mount uses "&" for the user name. With the following line as the volume to mount in
/etc/security/pam_mount.conf:
volume user smb FileServer % /home/%D/%U/H nosuid,nodev,workgroup=DOMAIN - -
pam tries to mount
//FileServer/DOMAIN-username where I would like it to mount
//FileServer/username
In
~/.pam_mount.conf there seem to be no interpretation of "&" beyond it's literal value.
.pam_mount.conf also doesn't seem to want to use system variable ($VARNAME). I do have a script that executes on user login and creates 3 environment variables like so:
Assuming $USER = DOMAIN-username then
$uName = username
$uDomain = DOMAIN
$uSeparator = -
(and no, that's not the script).
I tried using $uName in ~/.pam_conf but my guess is that the pam modules are run before any user bash scipts. Makes sense, but doesn't help me
I realize this is long and probably more convoluted than necessary, but if anyone can help I'd greatly appreciate it. If I've missed something obvious, please let me know and then flame on!
Thanks-
Olivier