Can someone tell me how to set up a mount to occur automatically on login? I have one directory per user on a Win network and I'd like each user to get his own directory mounted when he logs in. (Automounting on boot is ok, too). This is on Caldera eDesktop 2.4 with Samba 2.0.6. I can find and mount each directory just fine when logged in as root, but smbmount does not do the job when logged in as a user (since it requires root access). Thanks in advance, Eric -------------- next part -------------- HTML attachment scrubbed and removed
On Sat, 31 Mar 2001, Eric Kadison wrote:> Can someone tell me how to set up a mount to occur automatically on login? > I have one directory per user on a Win network and I'd like each user to get > his own directory mounted when he logs in. (Automounting on boot is ok, > too). This is on Caldera eDesktop 2.4 with Samba 2.0.6. I can find and > mount each directory just fine when logged in as root, but smbmount does not > do the job when logged in as a user (since it requires root access).You can get smbmount to mount as non root if you change smbmnt to be setuid root (chown root.root smbmnt; chmod u+s smbmnt). http://bazar.conectiva.com.br/~epx/exppack/exppack_auth_en.html pam_mount, 0.0.1 (alpha) version. I have not tested this. (There is also a 0.3.1 here, webpage seems a bit out of date http://bazar.conectiva.com.br/~epx/pam_mount/) You can do it with an autofs map for /home (or /home/auto) /etc/auto.master: /home/auto /etc/auto.home --timeout=60 /etc/auto.home: user1 -fstype=smbfs,username=user1,password=...,uid=user1 ://server/user1\$ user2 -fstype=smbfs,username=user2,password=...,uid=user2 ://server/user2\$ user3 -fstype=smbfs,username=user3,password=...,uid=user3 ://server/user3\$ ... I'd put the automounted stuff in a separate dir to allow keeping local things in /home. Having the passwords listed like this is ugly, make sure the auto.home file is root-readonly. autofs allows you to have a program provide the map, an "executable map". I haven't done that but it is basically a program that gets a "key" (user1) and provides a matching map entry if one is found. These are mounted when accessed, not on boot. You may need to upgrade autofs (3.1.5 is ok) if it complains about the options. If you run into trouble with smbfs you should try upgrading your kernel to 2.2.18 (19?) and samba to 2.2.0-alpha. smbfs doesn't provide the same operations as most unix filesystems do, you may see some problems because of that. One trick may be to have a local home dir and mount the windows home as a subdir (/home/user1 is a local dir, /home/user1/win is a remote dir). /Urban
Urban, Thanks for your quick reply. See issues below:> > > Can someone tell me how to set up a mount to occur > automatically on login? > > I have one directory per user on a Win network and I'd like > each user to get > > his own directory mounted when he logs in. (Automounting on boot is ok, > > too). This is on Caldera eDesktop 2.4 with Samba 2.0.6. I can find and > > mount each directory just fine when logged in as root, but > smbmount does not > > do the job when logged in as a user (since it requires root access). > > You can get smbmount to mount as non root if you change smbmnt to be > setuid root (chown root.root smbmnt; chmod u+s smbmnt). >I tried this and still cannot mount from a user id. It produces an error message indicating that only root can mount the volume. Someone else said that the code of smbmnt checked the user id for root.> > You can do it with an autofs map for /home (or /home/auto) > > /etc/auto.master: > /home/auto /etc/auto.home --timeout=60Caldera does not seem to use autofs. There is an amd demon running. Do you know if I can install autofs and run it together with amd? Alternatively, do I need to kill amd in order to use autofs?> > /etc/auto.home: > user1 -fstype=smbfs,username=user1,password=...,uid=user1 > ://server/user1\$ > user2 -fstype=smbfs,username=user2,password=...,uid=user2 > ://server/user2\$ > user3 -fstype=smbfs,username=user3,password=...,uid=user3 > ://server/user3\$ > ...Do you mean that, using autofs, the single file /etc/auto.home can have all the mounts for all user names? Does autofs then look at the name of the user logged in and automatically mount the volumes identified in /etc/auto.home for that user? Thanks, Eric
Hi Shaun, Thanks for the information on PAM. Do you know if it can be run together with amd? Is there anything about Caldera 2.4 (with a year old kernel) that could be incompatible? The current version is 0.3.1 --which seems pretty early. Is this a stable product that I can use for a system that requires minimum support? Thanks Eric> -----Original Message----- > From: samba-admin@va.samba.org [mailto:samba-admin@va.samba.org]On > Behalf Of Shaun Cloherty > Sent: Monday, April 02, 2001 9:54 PM > To: samba@va.samba.org > Subject: Re: Samba mount at Login? > > > Eric Kadison wrote: > > > Urban, > > > > Thanks for your quick reply. See issues below: > > > > > > > > > Can someone tell me how to set up a mount to occur > > > automatically on login? > > > > I have one directory per user on a Win network and I'd like > > > each user to get > > > > his own directory mounted when he logs in. > > We use pam_mount to achieve exactly this. From the > samba-technical archive; > > > > This PAM module does dynamic mounting of remote (SMB/NCP) > volumes for a user > > session. It reuses the login password (so the user does not > need to type it > > n > > times) and unmounts the volumes at logout. > > > > The tarball and RPM packages can be found at > > http://bazar.conectiva.com.br/~epx/pam_mount > > Combined with pam_winbind, these pam_mount provide a powerful means of > leveraging Linux into an NT dominated organization. > > Shaun > > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba >