Announcement

Collapse
No announcement yet.

Samba Question [solved]

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

    Samba Question [solved]

    Hello Guys, hoping you can help again as I've had success by posting on here before!

    I have the following setup:

    1PC running windows XP : users Chris, Delia
    1PC running ubuntu server
    1PC running kubuntu 8.10: users Chris, Delia

    i have successfully set up ubuntu server running Samba which shares 3 folders between 2 users Chris (me) & Delia (my wife):

    Media - configured so we can both access it
    Chris - personal space configures so only i can read/write and execute from it
    Delia - personal space configured so only my wife can read/write execute from it.

    All this works fine from windows xp, I can access my files, & media but not my wife's folder & conversely my wife can access media & her files but not mine.

    in kubuntu however, when i want to automatically mount these files at startup, i configure the /etc/fstab file. This all works fine until you begin to consider how to keep the user access as it is in windows. from all I've read, you can either define the samba user & password in the fstab file (insecure) or create a credentials file to contain user names & passwords (this works fine for me), however isn't the /etc/fstab file used regardless of which user is using the machine and won't that mean that that i can see my wife's personal folder & my wife can see mine? how is this overcome? any suggestions?

    Chris

    #2
    Re: Samba Question

    If you configure your share to be mounted in /home/chris and hers in /home/delia youcan use linux permissions to keep you from seeing the contents of each others folders, even though they are both mounted. Youwill need to set the folder permissions to something like 750. You might also look at using smb4k.

    Comment


      #3
      Re: Samba Question

      Would not a user with sudo privileges still be able to see all the files?

      Comment


        #4
        Re: Samba Question

        Of course.

        Comment


          #5
          Re: Samba Question

          Maybe he could use encryption to keep the files private.

          Comment


            #6
            Re: Samba Question

            Probably. There is a can of worms I don't think I have time for right now. I have not kept up with Samba but I doubt it has encryption itself. Is there a encrypted filesystem that is supported on Windows and Linux or would you have to use file encryption? Is there a compatible file encryption technology?

            Comment


              #7
              Re: Samba Question

              I have used TrueCrypt in a samba environment with success. But not with the goal of keeping users files separate but private. I'll have to give this some thought and post back.

              Comment


                #8
                Re: Samba Question

                This may help in smb.conf create mask= And directory mask=
                Do search on create mask for setting the correct permission that you want to use.

                Comment


                  #9
                  Re: Samba Question

                  Regardless of owner or file permissions, root will be able to read every file on the system.

                  Comment


                    #10
                    Re: Samba Question

                    Yep, I can't think of anyway to hide files from a user with root privileges. Even using an encryption program like TrueCrypt won't work, because you have to mount the encrypted volume to use the files, and if it's shared, then anyone with sudo privileges can access it. The files in a Truecrypt volume are only secure when the volume is unmounted.

                    Does your wife know you are trying to hide stuff from her?

                    Comment


                      #11
                      Re: Samba Question

                      lol Detonate,

                      I think the whole sudo user thing isn't an issue, I'm only trying to stop accidental file tampering really. I seem to have a condition where when my computers are working fine i get bored and fiddle with things until i break it, in doing this I've managed to accidentally wipe out my wife's email folder before, i caught hell for that and I'm anxious not to do something like that again!

                      the mounting of the respective private directories into the home folder seems the way to go but i am still having problems. I've had to create to credentials files to be able to mount the drives in the fstab file so when kubuntu mounts my network space it looks at /etc/samba/user containing my samba username & password and when it mounts my wife's network space it looks at /etc/samba/user1 for her samba username/password. Bizarrely, when i create a file in my network space kubuntu marks the folder as owned by my wife & not me, then i can't even write of delete it!

                      must be doing something simple wrong, but can't figure out what it is yet!

                      Chris

                      Comment


                        #12
                        Re: Samba Question

                        Do you have the appropriate numeric uids in the fstab line?

                        Comment


                          #13
                          Re: Samba Question

                          the trick is all in your smb.conf file.... sadly i don't have my smb.conf set ne more as i only use it for "guest" connections now (nfs much quicker when using linux and was ezer to setup too)

                          but in your smb.conf file (located in /etc/samba/smb.conf)
                          there is a share sections you will see something like

                          [sharename]
                          path=/home/chris/Documents (a share of my docs)
                          valid users =chris (will allow you to connect)
                          invalid users =delia (will block her from connecting)
                          writeable = yes (if you want to write here)

                          and i have here a very short example but check out this link for some more info

                          if need be i might have a copy of my old smb.conf file (i have a very similar set up only no xp machines ne more) and you may be able to use parts of mine
                          if you would like just let me know.
                          Mark Your Solved Issues [SOLVED]
                          (top of thread: thread tools)

                          Comment


                            #14
                            Re: Samba Question [Solved]

                            mando_hacker solved it,

                            adding the uid into fstab solved all the difficulties, thanks sithlord, had a look at your smb.conf suggestion. looks pretty much like mine apart from the invalid users line. not sure if this is necessery if the valid users line is in anyway, and instead of writable=yes i have read only=no which i think achieve the same thing?

                            thanks to all for your suggestions & help

                            Chris

                            Comment


                              #15
                              Re: Samba Question [solved]

                              i do almost everything w/ ssh or nfs now. but when i had did have samba set up i remember having issues restarting when i had a samba share mounted, i remember a work around but i can't seam to find it now, i had to simlink 2 files to the shutdown scripts... if i come across the info again i will post it here.
                              Mark Your Solved Issues [SOLVED]
                              (top of thread: thread tools)

                              Comment

                              Working...
                              X