View previous topic :: View next topic |
Author |
Message |
chaumess n00b
Joined: 11 Sep 2003 Posts: 64
|
Posted: Fri Oct 22, 2004 7:19 pm Post subject: cifs shares in fstab |
|
|
I've run into this bug, where mounting with smbfs makes the share disappear.
I can work around this by manually mounting as cifs shares as root. However, I don't want to have to manually do this. I want my fstab set up as before, so that as a normal user I can just type Code: | mount /mnt/servername/share |
So I go about editing my fstab. But there seems to be a problem here with mount.cifs and fstab. If I specify Code: | //server/share /mnt/point username=chris,user,rw,noauto 0 0 |
And then try mount /mnt/point as a normal user, I get: invalid or missing username.
If I remove the user option from fstab, and the try mount /mnt/point as root,it works fine. But of course, I don't want to be root to make this work.
It would seem that the options syntax for mount.cifs allows one to specify user= instead of username=, and I have a feeling that this is getting confused with fstab's user option, which allows non-root users to mount the share.
Anyone else run into this? Solution? |
|
Back to top |
|
|
shrike Apprentice
Joined: 20 Feb 2004 Posts: 187 Location: Closer to home
|
Posted: Mon Oct 25, 2004 2:23 am Post subject: |
|
|
I am not familiar with the disappearing share bug but the cifs docs refers to a credentials file as one option for user/passwd. It is something I've yet to try though. Just need some time.
Anyway, the README in /usr/src/linux/fs/cifs/ should help:
Allowing User Mounts
====================
To permit users to mount and unmount over directories they own is possible
with the cifs vfs. A way to enable such mounting is to mark the mount.cifs
utility as suid (e.g. "chmod +s /sbin/mount/cifs). To enable users to
umount shares they mount requires
1) mount.cifs version 1.4 or later
2) an entry for the share in /etc/fstab indicating that a user may
unmount it e.g.
//server/usersharename /mnt/username cifs user 0 0
Note that when the mount.cifs utility is run suid (allowing user mounts),
in order to reduce risks, the "nosuid" mount flag is passed in on mount to
disallow execution of an suid program mounted on the remote target.
When mount is executed as root, nosuid is not passed in by default,
and execution of suid programs on the remote target would be enabled
by default. This can be changed, as with nfs and other filesystems,
by simply specifying "nosuid" among the mount options. For user mounts
though to be able to pass the suid flag to mount requires rebuilding
mount.cifs with the following flag:
gcc samba/source/client/mount.cifs.c -DCIFS_ALLOW_USR_SUID -o mount.cifs
There is a corresponding manual page for cifs mounting in the Samba 3.0 and
later source tree in docs/manpages/mount.cifs.8
When I get some time I'll try it as well.
shrike |
|
Back to top |
|
|
yerhus n00b
Joined: 18 Apr 2002 Posts: 7 Location: Portugal
|
Posted: Thu Nov 04, 2004 3:25 pm Post subject: |
|
|
I had some problems with mounting cifs shares, regarding permissions and file ownership. I was able to solve them and now i can mount and unmount shares as a normal user and everything works just right...
My /etc/fstab (edited)
Code: |
//machine/share /home/user/share cifs user,rw,guest,noauto 0 0
//machine/share2 /home/user/share2 cifs user,rw,user=user%pass,noauto 0 0
|
The thing is that the user who is mounting must own the mountpoint or a permission denied error will popup |
|
Back to top |
|
|
richardash1981 Tux's lil' helper
Joined: 08 Apr 2005 Posts: 94 Location: England
|
Posted: Wed Dec 14, 2005 12:35 am Post subject: |
|
|
I still can't get it to mount as an ordinary user, I just get
Code: |
mount error 1 = Operation not permitted
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
|
with this in my /etc/fstab
Code: | //ystvedit2/Video /home/richard/tryagain cifs rw,gid=users,file_mode=0664,dir_mode=0775,nosuid,user 0 0
|
adding username= has no effect |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|