# how to mount samba shares from fstab... found answer, bug?

## hunterhalcomb

I'm trying to mount a samba share from a windows machine on my gentoo machine, using fstab. I can mount the share from the command line as root, and then use it as a user, but not mount it as a user. I'm trying to do this so that I can use the Disk Mounter applet in gnome to one-click mount the share, and Disk Mounter does "mount /mnt/whatever" to mount, which means I need my fstab to contain the mount. From what I gather in the man pages for mount and smbmnt, smbmnt ignores the "user" option in fstab (mount -t smbfs calls smbfs.mount which uses smbmnt).

I guess my question is, what option does smbmnt need to be used my a non-root user? My fstab, for what it's worth:

```
//kara/c      /mnt/kara_c   smbfs      noauto,users,_netdev,username=kara,password=####
```

but that doesn't work with "mount /mnt/kara_c" from a user, only root.

any ideas?Last edited by hunterhalcomb on Tue Jun 03, 2003 9:37 pm; edited 1 time in total

----------

## reaz82

try the option umask=000 among ur list of options..

the users option allows any user to mount and umount it..

so the users=kara is depracated.. kinda.. // my bad .. i forgot some stuff..

i use gnomba to selectively mount shares.. soo i havent used command line in a while

umask=000 gives everyone control of that drive.. including

root..

different settings give different kinds of control.. go figure..  :Smile: 

take careLast edited by reaz82 on Tue Jun 03, 2003 4:27 am; edited 1 time in total

----------

## hunterhalcomb

umm, I know what users does, I put it there because that's the behavior I want, but username=kara is a SMB specific option, and it's the login name I'm passing to the windows xp comp I'm connecting to. but I'll try what you suggested.

----------

## pjp

I thought I had read it was similar to NTFS drives as mentioned here.  I could be mistaken.

----------

## hunterhalcomb

I found the answer to this: smbmnt must be setuid root for a user to mount smb shares, and no amount of options passed to mount or in fstab will change that. Also, gentoo appears to install smbmnt setuid root in the first place, but in /usr/sbin, making it useless to users. If someone can confirm this, that would be nice; I think this is the case becasue smbumount is installed in /usr/bin as setuid root. Why just umount?!

anyway, for anyone insterested, I found the anser on the LinNeighborhood FAQ page (I love google!). I did this as root:

```
# cd /usr/sbin

# mv smbmnt /usr/bin

# chmod +s /usr/bin/smbmnt

```

Work perfect now! But should I submit a bug report or something?

----------

## helmers

Yes please!

Go to https://bugs.gentoo.org and lets the dev's know that somehting isn't kosher.

----------

## darksaidin

 *hunterhalcomb wrote:*   

> Work perfect now! But should I submit a bug report or something?

 

Yes, please. smbmount cannot be set +s, only smbmnt can - it doesn't make sense to put exactly that to sbin.

----------

## dfy

 *hunterhalcomb wrote:*   

> I found the answer to this: smbmnt must be setuid root for a user to mount smb shares, and no amount of options passed to mount or in fstab will change that. Also, gentoo appears to install smbmnt setuid root in the first place, but in /usr/sbin, making it useless to users. If someone can confirm this, that would be nice; I think this is the case becasue smbumount is installed in /usr/bin as setuid root. Why just umount?!
> 
> anyway, for anyone insterested, I found the anser on the LinNeighborhood FAQ page (I love google!). I did this as root:
> 
> ```
> ...

 

It doesn't work  :Sad:  . When I try to 

mv smbmnt /usr/bin

I get an error saying:

mv: cannot stat `smbmnt': No such file or directory

What should I do?

----------

## quill18

 *dfy wrote:*   

> It doesn't work  . When I try to 
> 
> mv smbmnt /usr/bin
> 
> I get an error saying:
> ...

 

You should probably use the full path of the file, like:

mv /usr/sbin/smbmnt /usr/bin

Use the 'whereis' command if you still can't find it.

----------

