Jump to content

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


seanmckinney
 Share

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.

Link to comment
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 ;)

Link to comment
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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...