/etc/fstab entry to allow users to mount samba shares

Lars Heineken Lars.Heineken at gmx.de
Tue Apr 23 14:57:02 GMT 2002


I'm sorry to tell, but I Had to drop the whole thing. When I mounted the volume as root, a single read-acces onto the mountes smb-share on the client-side locked his machine. The smb-server noticed nothing. The cd-rom is mounted via supermount. All windows-clients read the share without problems. -> Suggestions ? Reasons ?

A try with nfs showed other problems. With nfs I couldn't mount /mnt/cdrom. This worked after explicit mounting of /dev/cdrom, supermount disabled. I think the kernel prevents sharing of supermounted directories. 

It seems like there is no way to share a supermounted cd-rom (maybe with autofs ?) to different linux-clients.. :-(

On Tue, 23 Apr 2002 22:38:17 +0200 (CEST)
Urban Widmark <urban at teststation.com> wrote:

> On Tue, 23 Apr 2002, Lars Heineken wrote:
> 
> > I tried to make an entry in /etc/fstab to enable users to mount a
> > specific samba-share (here: //Heineken/CD-ROM)
> > 
> > //Heineken/CD-ROM /mnt/HeinekenCDROM smbfs user,auto,username="x",
> password"x"0 0
> > 
> > the only way to make this work is that the mount-destination is owned
> > by the user who want's to mount. So "lars" for example can do the
> > mount if /mnt/HeinekenCDROM is owned by "lars". As I don't want a
> > speparate mountpoint for each user, how can I solve this the "right"
> > way. Just like a CD-ROM mount ?
> 
> The right way is to throw away smbmount and use smbconnect. The problem 
> you are seeing is that mount reads the fstab but doesn't do anything with 
> the entries and just passes them to smbmount.
> 
> smbmount then does the mount syscall that mounts smbfs, but it doesn't
> (want to) understand the options mount has and interprets them differently
> (eg user).
> 
> smbconnect would mean that mount does the mount syscall, and also all the
> user/auto/noexec parsing so it would be identical to all other fs'. smbfs
> then calls smbconnect to get the connection.
> 
> The only problem with this is that smbconnect only exists on one of my
> machines and is not very well tested.
> 
> 
> There are a few other options that may be seen as less experimental:
> 
> * automount
> 
> Use autofs or some other automounter. Judging from the mount options you
> don't care if a user can access the cd some other user mounted.
> 
> With autofs the following:
> 
> /etc/auto.master:
> /mnt/heineken	/etc/auto.heineken	--timeout=60
> 
> /etc/auto.heineken:
> cdrom	-fstype=smbfs,username=x,password=x	://Heineken/CD-ROM
> 
> would mount the cdrom when someone tried to access /mnt/heineken/cdrom.
> A potential problem might be what happens when the cd is ejected on the
> other end. I know I have never tested that ...
> 
> * setuid root mount_heineken_cdrom
> 
> Another way to do this is to make a small setuid root program to do this
> mount. For safety all options should hardcoded into the program.
> 
> * modify smbmnt
> 
> The rule that only the user may mount on dirs he owns is implemented in
> smbmnt. You have the code, change it. Do note that it is a security risk
> to let users mount things wherever they want ...
> 
> /Urban
> 




More information about the samba-technical mailing list