LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Mount SMB drive as user: Operation Not Permitted (https://www.linuxquestions.org/questions/linux-general-1/mount-smb-drive-as-user-operation-not-permitted-211656/)

paco36 07-30-2004 07:33 PM

Mount SMB drive as user: Operation Not Permitted
 
I am trying to mount an SMB drive as a non root user.

The line in my fstab is:
//192.168.0.2/music /mnt/music smbfs user,auto,username=user,password=pass,umask=0

It should mount when the system boots. But in the rare occasion that the other machine is not on... it won't... obviously.

So I want to beable to mount it without being root.

When I type mount /mnt/music in console as a user it says:
cannot mount on /mnt/music: Operation not permitted
smbmnt failed: 1

Any Ideas?
Thanks
-paco

Peacedog 07-31-2004 04:36 PM

try mounting it to a point in your users home directory.
good luck.

cruzfernandez 09-08-2004 07:31 PM

have the same problem
 
i can solve my problem if i put the user as the OWNER of the directory. Probably that is why it works to peacedog. (chown cruz.root /mnt/share)

I need all the users to access the share, and this is not a solution.

this is a bug of smbfs, i am almost shure :(

in my log it shows this (dmesg):

smbfs: Unrecognized mount option noexec

CroMagnon 09-08-2004 08:59 PM

cruz: try chown cruz:users /mnt/share, and chmod g+rx /mnt/share

everyone in the users group *should* be able to access the share regardless of who mounted it (though I think all activity will be logged as if by the user who did the mount, since the system will use that username and password). Add +w permission if that's appropriate.

peacedog - in the interests of learning and living, you might like to know there's a typo in your signature (your instead of you're) :)

cruzfernandez 09-08-2004 10:03 PM

You are correct, but the share can ONLY be mounted by user cruz.

there must be a bug in smbmount. In many pages this problem is mentioned, and no real solution is posted.

a lot of :study: is required to solve this problem.

CroMagnon 09-08-2004 11:32 PM

Ah, I misunderstood - I thought you meant they all needed access to it, not that they all needed to be able to mount it.

From the smbmnt man page:
A setuid smbmnt will only allow mounts on directories owned by the user, and that the user has write permission on.

(and of course, a non-suid smbmnt can only be run by root).

You can get around this by giving the users group write access to /mnt, and making a script that creates the directory and mounts the share via smbmount, and another that removes the directory after smbumount. It's a bit of a pain, and you have to retrain your users to run your script instead of mount <dir>, but it will work.

Another option would be to set up a root cron job that checks the status every <x> minutes and reconnects if necessary.

cruzfernandez 09-12-2004 06:07 PM

mmmh.. interesting workaround

what if i touch the code of smbmount and change it so it looks at /etc/fstab to check user?????

https://bugzilla.samba.org/show_bug.cgi?id=1617

that would fix the bug????


All times are GMT -5. The time now is 01:09 AM.