# :Operation not permitted

## MCK

Hi!

I got samba configured, and can browse other windoze-machines with konquerer/whatever. As root, I can mount a share on a windoze-server (which I can access with guest account) with

mount -t smbfs -o guest //server/share /mnt/server/share

No Problem here. Now I put a line in /etc/fstab:

//server/share  /mnt/server/share   smbfs  guest,noauto,user  0 0

to allow my user to mount the share. If I mount it as root now with

mount /mnt/server/share

it still works. But if I try mount /mnt/server/share as user, I get:

cannot mount on /mnt/deepnetserv/deepnet1: Operation not permitted

smbmnt failed: 1

I really dunno why Operation is not permitted...  :Sad:  Anyone a suggestion?

TIA

----------

## MCK

Small update:

If I create the directory which the share will be mounted on with the user who will mount it, then it works! But I don't understand why it is not allowed to mount on /mnt/share... I mean it works with cdroms e.g. too... just not with smbfs... I don't think that I have to set some special permissions to the /mnt/share directory to be able to mount as a user, as I don't need to do that with /mnt/cdrom or something...  :Sad:  any ideas?

TIA

----------

## pjp

In order to mount the cdrom as a user, you probably have something like this in your /etc/fstab

```
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro,users 0 0
```

The 'users' option allows users to mount the cdrom.  I'm guessing there might be a permission issue on /mnt/share.  Just a guess, I've used samba very little (and not recently).

----------

## miez

I had the same problem while mounting a samba share in my company.

For working on a project deploying HELIOS on linux for our customers, i've no spare time to struggle aroud with this problem.

Here's my ugly workaround:

Do an id <your login> and put a line like

//<server>/<share> <mountpoint> smbfs noauto,uid=<your uid>,gid=<your gid>,username=<your login>,password=<your passwd> 0 0

in your /etc/fstab.

You can mount the share sa root and use it as ordinary user.

Maybe i can post a better solution in in the near future..   :Confused: 

----------

## MCK

hi, THX for your solution  :Wink: .

Well, I also have a "solution": I just made a directory /mnt/<user>/<share> which is owned by the user and which the share is mounted on... seems to work.  :Smile: 

----------

## Oo.et.oO

so smbmount has a "feature" whereby the "mounter" must have permissions on the mountpoint.

this is because it doesn't pay attention to /etc/fstab

if one runs mount /mnt/blah

where /mnt/blah is specified as a smb share in /etc/fstab, mount uses the entries, but doesn't care about the user option as it just passes them to smbmount which ignores the user option because if it did it would be "locked in, in future versions of samba"  

why this is a bad thing is beyond me and i guess the samba maintainers are content leaving smbmount different from the other mounters it is trying to emulate. 

my solution is to make a samba group, who has permission on all the "samba" mount points i make.  

then put the users who need to mount samba shares in that group.

crappy situation.  only solution really without making smbmount suid root (ack!).

-e

----------

