Jump to content
Sign in to follow this  
seanmckinney

unmounting a 'samba file', user can't, why?

Recommended Posts

Just curious really as I can alway su to root and umount it. fstab contains the line

 

//Mk4/250G /home/sean/samba_mounts/250G smbfs noauto,user

 

It may be primitive but it works allowing me, as a user, to mount this but, as the same user, I cant umount it, I am just curious as to why I cant umount it?

 

 

Thanks.

Share this post


Link to post
Share on other sites

You can try "users" as well and see if it makes a difference.

Share this post


Link to post
Share on other sites

Aye :)

 

From the link:

 

For more details, see fstab(5). Only the user that mounted a filesystem can unmount it again. If any user should be able to unmount, then use users instead of user in the fstab line. The owner option is similar to the user option, with the restriction that the user must be the owner of the special file. This may be useful e.g. for /dev/fd if a login script makes the console user owner of this device. The group option is similar, with the restriction that the user must be member of the group of the special file.

 

so in essence, if you put users instead of user, you can then unmount it regardless of the user. If you put user, then only the user that mounted it can unmount it, in this instance, only root. If you put a group, then of course, you just need to add yourself to the group, and then you can unmount it. This is good, since you can have multiple users on the system, one can unmount it, but the other cannot unless they are a member of the group. If you are the only user, then putting users is enough to fix this problem as you've just done ;)

Share this post


Link to post
Share on other sites

Either use cifs instead of smbfs (IMHO a better solution/performer), or tell samba mount to run suid root (it's not such a big security risk):

 # chmod u+s /usr/bin/smbmnt
# chmod u+s /usr/bin/smbumount

 

Also, get sure that the mountpoint ( /home/sean/samba_mounts/250G ) permissions aren't borked, and user "sean" has at least full read/write access, if not full ownership.

Edited by scarecrow

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...