Announcement

Collapse
No announcement yet.

smbmount doesn't work like Samba?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    smbmount doesn't work like Samba?

    I'm currently having an issue with smbmount. I have three directories on a central server that are set up to be accessed with read/write by members of an authorized group and readable by only two authorized users (though I'm thinking about changing it to readable by only the member of the authorized group). On the central server all three directories are owned by root, have the authorized group, and the permissions are "drwxrwx---."

    When I access them directly with Samba it works like you would expect. Authorized user connects, authorized user is a member of the authorized group and thus can write changes to everything in the directories.


    The problem is when I use smbmount with a client machine's fstab in order to make it permanently mounted. For the sake of simplicity I duplicated the parent directory structure (the three directories on the server are under /usr/local/share/ and on the client they are under /usr/local/share/ as well). I even named them the same and used the same permissions, owner, and group settings, just left them empty for mounting purposes.


    In my fstab I mount them as such:
    //assault/Music /usr/local/share/Music smbfs credentials=/home/foxx/.smbpasswd,gid=staff,rw 0 0
    The same follows for the other two directories. For some reason even with the rw flag the directories don't have the permission set I gave them elsewhere instead changing to "drwxr-xr-x" which breaks the security model I've been trying to achieve. To modify the files by Samba directly limits my accessibility since many programs do not recognize a smb:// stream.


    Any ideas why on earth smbmount isn't working the same was as Samba? Any fixes I can apply? Or am I stuck with a broken smbmount?
    Just a fox, a whisper.

    #2
    Re: smbmount doesn't work like Samba?

    At least you are not alone: http://kubuntuforums.net/forums/inde...opic=3082174.0

    Comment


      #3
      Re: smbmount doesn't work like Samba?

      Taking a look through there it appears my exact problem isn't encountered. I took a look through both machines' smb.conf and found no trace of a msdfs to remove unfortunately.


      I've been wondering more and more about mounting calls. Would it be possible to specify a drwxrwx--- directory permission to the mounted directory with the mount command? If it is then perhaps there's a way around it not working with smbmount.


      I'd use NFS but honestly for my purposes I'm better off learning more about Samba and practicing with it. I really want this to work and it's so close I can feel it, I just need group writable capability and it's done (well, and to remove anyone else from reading it but that's a connected matter).

      Surely SOMEONE out there has got to have made this work before, right?
      Just a fox, a whisper.

      Comment


        #4
        Re: smbmount doesn't work like Samba?

        Just a silly idea: what happens when you wrap those three mount commands up in a shell script to be parsed at user log-in (e.g. by placing it in ~/.kde/Autostart)?

        The (possibly absurd) reasoning behind this: the file system table (/etc/fstab) is processed at boot time, read: on root level.

        Comment


          #5
          Re: smbmount doesn't work like Samba?

          Dunno but I like your reasoning, I'll try it out tomorrow and report back.
          Just a fox, a whisper.

          Comment


            #6
            Re: smbmount doesn't work like Samba?

            Using mount.smbfs I was able to get it to work but I had to use sudo since the suid bit isn't set for mount (not to mention that sounds like a security risk to allow ALL users to mount anything though I could be wrong about that. Please enlighten if I'm thinking about it wrong) but that returns me to the same issue I've already got, being mounted by root with the drwxr-xr-x permission set instead of root, staff, and drwxrwx---.
            Just a fox, a whisper.

            Comment


              #7
              Re: smbmount doesn't work like Samba?

              Originally posted by FOXX
              but that returns me to the same issue I've already got
              O.k., back to square one, then: in the entries to the file system table, replace the file system type smbfs by cifs - and then remount, retry and repost, as applicable ...

              Comment


                #8
                Re: smbmount doesn't work like Samba?

                Hmm, I'll give it a shot but at the moment I've got a workaround going.

                Basically due to my security model I needed ONLY root and the members of a certain group having access at all to the directories and I noticed that the gid=<arg> option seemed to work okay. Given that I tried out the dmask option to set the options for all the directories to 770 (rwxrwx--- for those who don't "get" octal) and that seems to work out okay. The specified users in the group can now read and write normally in it, just like when I connect to it through samba directly (I have to admit I keep wondering why on earth I'm doing this with smbmount when smb seems to work fine...then I remember how most programs I need to read these directories don't understand smb shares).


                Here's the weird thing. You set the fmask to something like 660 and...absolutely zero change. It's strange, the dmask works fine but the fmask doesn't. I think this might have something to do with a change in the default settings of the files. With the current setup now (dmask in use since it works and fits the security model) I can create files like "touch test.txt" in the directories just fine. However, the permissions, owner, and group are completely different ON the server, but not through the mount!

                It's really strange but at the moment I'm not too concerned since with the dmask in place people who shouldn't be able to even SEE those files won't be able to (no read or execute directory access unless you're in the group or root). Still, interesting nonetheless. I wonder if it may just be the way samba works or if it's connected with some of the issues other people are having.
                Just a fox, a whisper.

                Comment

                Working...
                X