Debian Lenny: Samba upgrade error "user" CIFS mounts broken

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Debian Lenny: Samba upgrade error "user" CIFS mounts broken

Post by ^rooker »

[PROBLEM]
After upgrading Samba in Debian Lenny to the current backports version "3.5.6", I couldn't mount CIFS shares as non-root user anymore:
/sbin/mount.cifs: not installed setuid - "user" CIFS mounts not supported.
Ok. So I thought: well, then let's add the setuid flag!

Code: Select all

chmod u+s /sbin/mount.cifs
Which didn't improve my situation, because then I got the following error message:
This mount.cifs program has been built with the ability to run as a setuid root program disabled.
mount.cifs has not been well audited for security holes. Therefore the Samba team does not recommend installing it as a setuid root program.
[SOLUTION]
Add the desired userid and groupid to the fstab entry. Previously, those values were automatically determined by the owner of the mountpoint folder.

Now, find out which "uid" (userid) and "gid" (groupid) the user has, that you want to mount the share as:

Code: Select all

id -u <username>
id -g <username>
Let's say userid and groupid are "33".

So previously, the fstab entry might have looked like this:

Code: Select all

//computername/share /mnt/whatever smbfs noauto,user,username=xxx,password=bla 0 0
Now add the uid and gid values to that entry:

Code: Select all

//computername/share /mnt/whatever smbfs noauto,user,uid=33,gid=33,username=xxx,password=bla 0 0

== References:
http://forums.fedoraforum.org/showthread.php?t=239592
https://bbs.archlinux.org/viewtopic.php?id=113269
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply