Page 1 of 1

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

Posted: Wed Feb 16, 2011 5:14 pm
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