Trouble mounting SMB shares [11.2]

I have a little logon start up script which attaches a samba share using the line

/sbin/mount.cifs //$SERVER/$USER $HOME/$import -o user=$USER .....

This used to work fine until an update. I now get a message

/sbin/mount.cifs: permission denied: no match for /home/<user>/.import found in /etc/fstab

The fix for this is self evident - just add the required entry to fstab.

But it seems to be a totally unnecessary pain to add this entry for all users and for all the possible places users might wish to mount shares within their own space. An entry in /etc/fstab never used to be required.

Is there any work around for this? Has something changed? Is there an option cahnge I have missed on /sbin/mount.cifs

Any input welcome on this.

Bump. Anyone?

Yes, I too had the same problem. A change was made in mount.cifs, which appears to have been initiated by Jeff Layton at Redhat some months ago. I think this is the correct reference:

Samba - [PATCH] mount.cifs: properly check for mount being in fstab when running setuid root

I first noticed the change in Suse 11.3. My solution was to use old versions of mount.cifs and umount.cifs in place of the current ones. Hence, I renamed the current versions in /sbin and stored the old versions in /usr/local/sbin. Seems to work very well for both 11.2 and 11.3.

Hope that helps.

Thanks plodder!!! I have had a brief scan and I am going to go back and take another longer look. It seems like someone has had a bee in their bonnet and has broken this for a not a lot of benefit.

you have to add samba (smb and nmb) in your firewall configuration to get connected.

Or just use it, like it is intended to use - use “mount” and not “mount.cifs”.

As it reads: “Mount helpers are never intended to be called directly…” - so it is actually a good ting that they have closed that hole. Now, the unprivileged users cannot just mount a cifs-share anymore :slight_smile:

This is not an issue. It was a working installation which was broken by an update - and as originally posted, a connection was made.

You think that is a bad thing? It is exactly what I want to do. I want my unprivileged users to mount cif shares - just like in windows.

If it is security, well I have used mount. Now it looks like I have to use the share logged on as root. Something is seriously broken with this idea of security.

On 10/30/2010 02:06 PM, DVardysShadow wrote:
>
> You think that is a bad thing? It is exactly what I want to do. I want
> my unprivileged users to mount cif shares - just like in windows.
>
> If it is security, well I have used mount. Now it looks like I have to
> use the share logged on as root. Something is seriously broken with this
> idea of security.

Set up sudoers to allow users to mount the cif share without having to know the
root password. I am the only user on my system, but I use this method to mount
my NFS shares without having to enter the root password.

Thanks! That looks promising