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:
Ok. So I thought: well, then let's add the setuid flag!/sbin/mount.cifs: not installed setuid - "user" CIFS mounts not supported.
Code: Select all
chmod u+s /sbin/mount.cifs
[SOLUTION]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.
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>
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
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