Samba mount at Login?

Urban Widmark urban at teststation.com
Sun Apr 1 10:30:42 GMT 2001


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





More information about the samba mailing list