On Sun, 15 Jul 2001, Ambrosius wrote: a> I've been dorking with this for months now and finally got a hairbrained a> idea that worked. I use this so that my working account (non-privilaged a> user) can activate SaMBa share mounts as needed. Description follows with a> examples. in my /etc/fstab file I added these entries: a> a> //harlette/linux /net/harlette harlette noauto,user 0 0 a> a> This tells the system anytime I try: mount /net/harlette that it's a a> harlette filesystem. It looks in /sbin and finds a mount.harlette script a> which basically has this in it: a> a> #! /bin/sh a> echo "Attempting to mount share on Harlette" a> mount.smbfs \\\\harlette\\linux /net/harlette -o a> username=the-username,password=the-password a> a> This appears to be working for both mount and umount even via a a> non-privilaged user. Which is what I needed. a> a> The /sbin/umount.harlette script has: a> #! /bin/sh a> echo "Attempting to unmount share on Harlette..." a> umount /net/harlette a> Any particular reason why your not using the autofs package? This does pretty much what you are intending by mounting a share whenever you make an attempt to access it. After a certain ammount of inactivity on that share, it automatically unmounts it. Here's what I have in my autofs files: skull@daydream:~ > ypcat -k auto.master /home auto.home -nosuid,noquota /auto auto.misc -nosuid,noquota skull@daydream:~ > ypcat -k auto.home skull -rw,intr,nosuid,noquota wetdream:/home/skull nitz -rw,intr,nosuid,noquota wetdream:/home/nitz skull@daydream:~ > ypcat -k auto.misc music -rw,intr,nosuid,noquota wetdream:/music public -rw,intr,nosuid,noquota wetdream:/public I use ypcat because the files actually reside on the server and are shared with yp to the workstations. The following is what happens when I try and access nitz's home directory: skull@daydream:/opt/moneydance > ls /home skull skull@daydream:/opt/moneydance > ls /home/nitz ls: /home/nitz: Permission denied skull@daydream:/opt/moneydance > ls /home nitz skull as you can see from the first example, nitz isn't mounted because I've never accessed it, but as soon as I try, you can see that it's mounted. Your /etc/mtab file soon begins to look like the following: skull@daydream:~ > cat /etc/mtab /dev/hda7 / reiserfs rw 0 0 proc /proc proc rw 0 0 /dev/hda5 /boot ext2 rw 0 0 devpts /dev/pts devpts rw 0 0 automount(pid270) /misc autofs rw,fd=5,pgrp=270,minproto=2,maxproto=4 0 0 automount(pid275) /net autofs rw,fd=5,pgrp=275,minproto=2,maxproto=4 0 0 automount(pid296) /home autofs rw,fd=5,pgrp=296,minproto=2,maxproto=4 0 0 automount(pid309) /auto autofs rw,fd=5,pgrp=309,minproto=2,maxproto=4 0 0 wetdream:/public /auto/public nfs rw,nosuid,noquota,intr,noquota,addr=192.168.0.11 0 0 wetdream:/home/skull /home/skull nfs rw,nosuid,noquota,intr,noquota,addr=192.168.0.11 0 0 wetdream:/music /auto/music nfs rw,nosuid,noquota,intr,noquota,addr=192.168.0.11 0 0 wetdream:/home/nitz /home/nitz nfs rw,nosuid,noquota,intr,noquota,addr=192.168.0.11 0 0 and after a few minutes (seems like about 10) of not accessing nitz's home directory you'll see the following: skull@daydream:~ > ls /home skull with the following no in /etc/mtab skull@daydream:~ > cat /etc/mtab /dev/hda7 / reiserfs rw 0 0 proc /proc proc rw 0 0 /dev/hda5 /boot ext2 rw 0 0 devpts /dev/pts devpts rw 0 0 automount(pid270) /misc autofs rw,fd=5,pgrp=270,minproto=2,maxproto=4 0 0 automount(pid275) /net autofs rw,fd=5,pgrp=275,minproto=2,maxproto=4 0 0 automount(pid296) /home autofs rw,fd=5,pgrp=296,minproto=2,maxproto=4 0 0 automount(pid309) /auto autofs rw,fd=5,pgrp=309,minproto=2,maxproto=4 0 0 wetdream:/public /auto/public nfs rw,nosuid,noquota,intr,noquota,addr=192.168.0.11 0 0 wetdream:/home/skull /home/skull nfs rw,nosuid,noquota,intr,noquota,addr=192.168.0.11 0 0 wetdream:/music /auto/music nfs rw,nosuid,noquota,intr,noquota,addr=192.168.0.11 0 0 you'll notice the last entry for /home/nitz is now missing. a> -- S.Toms - smotrs@mindspring.com - www.mindspring.com/~smotrs SuSE Linux v7.0+ - Kernel 2.2.18 "Nuclear war would really set back cable." -- Ted Turner