Announcement

Collapse
No announcement yet.

Fiesty & Windows XP = Samba???

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

    Fiesty & Windows XP = Samba???

    Ok, I'm in need of some help that is explained simply for me. I'm a long time Linux user, but this networking is driving me crazy!!! I have a Windows XP computer a Kubuntu Fiesty computer and would like to share files between them easily. I followed this howto guide: http://ubuntuforums.org/showthread.php?t=202605

    My problem is my Kubuntu and Windows don't have the same username or password. I'm getting confused on what passwords, and users to add etc. Here is my smb.conf :
    Code:
    [global]
      ; General server settings
      netbios name = SAK
      server string =
      
      announce version = 5.0
      socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
    
      passdb backend = tdbsam
      security = user
      null passwords = true
      username map = /etc/samba/smbusers
      name resolve order = hosts wins bcast
    
      wins support = no
    
      printing = CUPS
      printcap name = CUPS
    
      syslog = 1
      syslog only = yes
    
    ; NOTE: If you need access to the user home directories uncomment the
    ; lines below and adjust the settings to your hearts content.
    ;[homes]
      ;valid users = %S
      ;create mode = 0600
      ;directory mode = 0755
      ;browseable = no
      ;read only = no
      ;veto files = /*.{*}/.*/mail/bin/
    
    ; NOTE: Only needed if you run samba as a primary domain controller.
    ; Not needed as this config doesn't cover that matter.
    ;[netlogon]
      ;path = /var/lib/samba/netlogon
      ;admin users = Administrator
      ;valid users = %U
      ;read only = no
    
    ; NOTE: Again - only needed if you're running a primary domain controller.
    ;[Profiles]
      ;path = /var/lib/samba/profiles
      ;valid users = %U
      ;create mode = 0600
      ;directory mode = 0700
      ;writeable = yes
      ;browseable = no
    
    ; NOTE: Inside this place you may build a printer driver repository for
    ; Windows - I'll cover this topic in another HOWTO.
    [print$]
      path = /var/lib/samba/printers
      browseable = yes
      guest ok = yes
      read only = yes
      write list = root
      create mask = 0664
      directory mask = 0775
    
    [printers]
      path = /tmp
      printable = yes
      guest ok = yes
      browseable = no
    
    ; Uncomment if you need to share your CD-/DVD-ROM Drive
    ;[DVD-ROM Drive]
      ;path = /media/cdrom
      ;browseable = yes
      ;read only = yes
      ;guest ok = yes
    
    [MyFiles]
      path = /home/shane/share/
      browseable = yes
      read only = no
      guest ok = no
      create mask = 0644
      directory mask = 0755
      force user = shane
      force group = shane
    HELP! I also posted at that how to, you can see my posts at the end. I came over here to post in case there is a Kubuntu specific problem or in case someone over here can give me some more insight! Thanks.

    Shane
    John 3:16 - For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

    #2
    Re: Fiesty & Windows XP = Samba

    Couple things. First, it's not Kubuntu specific. I checked your smb.conf against mine and there seems to be a problem with the last part of yours. I'll paste the last section for you to see
    [MyFiles]
    path = /home/samba/
    create mask = 0644
    force user = princey
    force group = princey
    case sensitive = no
    strict locking = no
    msdfs proxy = no
    Secondly, for SAMBA to work, there must be the same account setup on both. In otherwords, I do recommend setting up a 'dummy' account and username/password on both even if you don't physically use those accounts. Try that and use it to log in and let me know what happens.
    Challenges are what that keeps us from the borderline of boredom in life's journey. Linux user no. 419401 currently running Kubuntu 24.04
    _______________________________________________
    Current System: Beelink Mini PC, AMD Ryzen 7 5800H 8 Core(Up to 4.4GHz), 32GB DDR4 RAM 1TB NVME M.2 SSD, SER5 MAX Mini Desktop Computer with TCL BeyondTV5 serving as my monitor. ​

    Comment


      #3
      Re: Fiesty & Windows XP = Samba

      ok, I changed the conf to read like yours at the end:
      Code:
      [MyFiles]
        path = /home/shane/share/
        ;browseable = yes
        ;read only = no
        ;guest ok = no
        ;create mask = 0644
        directory mask = 0755
        force user = shane
        force group = shane
        strict locking = no
        msdfs proxy = no
      I just commented out the others. Ok, I have a question when I add a user with the
      Code:
      sudo smbpasswd -L -a username
      sudo smbpasswd -L -e username
      I want/need to enable my own user name for Kubuntu with my password? Or do I need to use the Windows username and password, or do I need to make up a new one? This part has me really confused. Thanks for the quick reply.

      EDIT: Ok, I just noticed I commented out the wrong line, and fixed that. I also have been restarting samba after every change to the conf file. Do I need to reboot windows after changing that file? Thanks.


      Shane
      John 3:16 - For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

      Comment


        #4
        Re: Fiesty & Windows XP = Samba

        OK, I don't want to gum up the works here, but I have a few things I could add. First, the how-to that you read is kind of old and was written a few ubuntu-generations ago. It's not wrong now, but the ubuntu developers have greatly simplified samba for "basic" file sharing. Enough that for many cases you probably shouldn't have to edit your smb.conf file by hand at all, depending on how much stuff you want to share and how you want to share it.

        I think what you should have done is just do the "install Samba" so that you get an option in System Settings -> Sharing to enable file sharing. If you did that, then you would just have to find a folder in your home folder, right click it, and select "share". Then click the box next to "share this folder". This way it would have worked in Kubuntu pretty much just like it does in Windows, and when you open the network neighbourhood in XP you would have seen your Samba-shared folder. If I were you, before I edited any more configuration files, I think I would actually just try to do it this way and see what happens.

        Assuming that it doesn't work that way, here are at least some tidbits on Samba that might help you out where you are now. It sounds like your greatest confusion is on the several user accounts, so here's some background.

        First, on the user accounts, there are actually three in play. First, a "user" needs to have a username and password for Linux just to get a Linux session. Second, Samba needs to have a username and password for anyone that tries to connect to a Samba share. Third, XP has to have a user with a username and password for anyone that logs in to the XP box. These are three different *entities*.

        Now, assuming that Samba is sharing out a folder correctly, the way things work is this:
        When a person logs in to the XP box, they do so with the Third un/pw (the XP un/pw). During that XP session, if the person tries to connect to a folder on a Linux box that is shared out with Samba, XP will communicate with Samba and hand Samba the XP un/pw so that Samba can authenticate the user. Samba will check its database to see if there is a Samba user with the same credentials as the person trying to connect. In other words, if your XP un/pw matches the un/pw of a user in the Samba database (the Second un/pw), then Samba will accept the user. Note that if either the XP un or pw don't match a Samba user, then Samba will reject that user. It might prompt for a good un/pw, but then again it might not. Samba is fickle.

        But that's not it. Now, if Samba authenticates the user, that user still wants to touch resources on the box that is hosting Samba. That means there also needs to be some Linux user account (the First un/pw) that matches the same un/pw as the XP and Samba user accounts, otherwise Linux won't let the user do anything. This is why it's best to have the exact same username/password everywhere (XP, Samba, Linux). Is that confusing enough?

        With all that said, the kubuntu devs have made great strides, I think, in pushing all this stuff to the background. If you just enable the file sharing through the "System Settings -> Sharing" way, kubuntu takes care of most of the configuration to make sure that the Samba and Linux user accounts are synced up so that you don't have to worry about the different Samba and Linux users. Believe me, this eliminates a ton of the headaches that you are having right now. The problem is that you may have already edited the smb.conf file such that the simple kubuntu way won't work anymore. More specifically, I see the line "passdb backend = tdbsam" in your smb.conf. That line tells Samba what method to use to authenticate users' passwords. I just don't know if that's different from what Kubuntu expects these days, or maybe it's the same.

        Wow, this is really long but hopefully it's helpful. And to sum up, if you are going to do this the hard way, make sure you create a user account with kubuntu having some un/pw pair. Then add the exact same username to Samba using the "smbpasswd -a " method, giving it the same password. Then make sure that the un/pw of your XP account is exactly the same as the ones on your kubuntu box.

        Comment


          #5
          Re: Fiesty & Windows XP = Samba

          You also need to remove the line, mdfs proxy = no from your smb.conf file, and every time you modify the smb.conf file using a KDE GUI check to make sure it's not there. This is a known bug. Search the forum for more info on that.

          Comment


            #6
            Re: Fiesty & Windows XP = Samba

            gypsy98101

            THANK YOU THANK YOU THAAAAAANK YOU!!!

            That is exactly the source of all my confusion. Why couldn't that have been gone over in the guide somewhere? Yeah, I knew that guide was a little old. The good news is that I can restore my original smb.conf file that came when I installed samba - the guide said to back it up, and eliminate all this confusion. Or if I removed Samba with the purge option doesn't that eliminate all my config files too? I'm still a little unclear on the users part. If I understand you correctly, I need to add a user to Linux with my XP us/pw? That is actually adding them to my user accounts. However then the share file is going to be in my home folder, and I linked another folder in that folder so that Linux user is going to need permissions to access that folder and link if I understand everything correctly.
            Also, for kicks I shut off ZoneAlarm on the XP box, and could see the network from both computers. I had configured ZoneAlarm to trust my IP, but I have ZoneAlarm set to the strictest settings, so even the trusted IP's don't have access to the computer . That is ok, because I want to understand this users business.
            Ok, so when I try to access the Linux folder on the XP box, and it asks for a password, I need to give it the Samba us/pw. Is that correct? Ok, one more question, where is the Samba us/pw specified? When I add a user to Samba, with the smbpasswd -a that then becomes a Samba us/pw is that correct? Even if it is the same as my XP us/pw or Linux us/pw, it is a Samba us/pw now?

            Thanks for this help.

            Shane
            John 3:16 - For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

            Comment


              #7
              Re: Fiesty & Windows XP = Samba

              Originally posted by Detonate
              You also need to remove the line, mdfs proxy = no from your smb.conf file, and every time you modify the smb.conf file using a KDE GUI check to make sure it's not there. This is a known bug. Search the forum for more info on that.
              Ok, thanks. I will comment that out.

              Shane
              John 3:16 - For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

              Comment


                #8
                Re: Fiesty & Windows XP = Samba

                ok, I think I'm getting somewhere now. I configure it so that I can see the XP computer and the XP computer can access my files, however when they are opened (a document file) it is read only permissions. I need XP to be able to edit these files too. I opened up the users under system settings and there already was a user created with the XP us/pw. I changed it's group and everything to be included in my group. Although I don't have a good understanding of all that, I think I'm getting closer. I would like to understand it too though. Thanks.

                Shane
                John 3:16 - For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

                Comment


                  #9
                  Re: Fiesty & Windows XP = Samba

                  Ok, now on to the hard stuff.

                  First, your questions, re-ordered:

                  Ok, so when I try to access the Linux folder on the XP box, and it asks for a password, I need to give it the Samba us/pw. Is that correct?
                  Yes, when you are on the XP box trying to connect to the Kub box, it is actually Samba that is authenticating you.

                  Ok, one more question, where is the Samba us/pw specified? When I add a user to Samba, with the smbpasswd -a that then becomes a Samba us/pw is that correct? Even if it is the same as my XP us/pw or Linux us/pw, it is a Samba us/pw now?
                  Yes, the command "smbpasswd" is how you create a new Samba user and also set or change the password for that Samba user. It becomes its own separate entity, which hopefully happens to have the same credentials as both a Kub user entity and an XP user entity (if you want to keep your sanity).

                  If I understand you correctly, I need to add a user to Linux with my XP us/pw?
                  If your XP account doesn't have the same un/pw then I would, yes. This would make life easier.

                  However then the share file is going to be in my home folder, and I linked another folder in that folder so that Linux user is going to need permissions to access that folder and link if I understand everything correctly.
                  This is where it gets tricky. So now that I think you understand the whole "three separate entities" thing, let's see how they interplay and why it matters.

                  When you share a folder using Samba, obviously it has to exist on your Kub file system. Because it does, it has permissions that define what a user can do with resources in that folder. You probably know that those permissions are set on an owner/group/other basis. This is the *Kubuntu* user, not necessarily the Samba/XP user.

                  So looking at your smb.conf file, you have "create mask = 0644" for the folder that you shared. What that means is that the Kub user who is logged in has read/write perms, but everyone else (group/other) has read only perms. So if you log in on your XP box using exactly the same un/pw as the Samba un/pw AND as the Kub un/pw, then that user should be able to read and write to the share. But unless all those un/pw are the same, you won't. It will be read only because your Samba/XP user is NOT the same as the Kub user. So you can do one of two things, either make sure the XP/Samba/Kub usernames and passwords are all the same, or you can change the create mask to allow r/w perms to users other than the owner. Like maybe 664 or something.

                  Further complicating things, and this is the part that gets lots of folks, is that the folder you are sharing must have sufficient permissions to allow the Samba entity to do whatever you want. So in your smb.conf file, you are sharing out the Kub folder "/home/shane/share". Assuming you are the user "shane" then when you are logged in on the Kub box as "shane" you are the owner so you have all the perms you need in that folder. But if your Samba login is NOT shane, then that Samba user is not the owner, but rather either just a group member or worse still only an "other". So you need to check what permissions are set on that shared folder.

                  If you want to have an XP entity that is DIFFERENT from "shane" log in to the Kub box, then you must address the permissions on the folder /home/shane/share to allow the XP entity to do whatever it is you want to allow. You can do this a couple ways. You can change the permissions on the shared folder to something like 777, which gives everyone read/write access. Or you can make sure that your create a user account on the Kub box with the same credentials as your DIFFERENT XP/Samba entity, and then add that new user account to a GROUP that has read/write perms on the folder.

                  Before I go any farther, does all this make sense?

                  Comment


                    #10
                    Re: Fiesty & Windows XP = Samba

                    Originally posted by shane2peru
                    ok, I think I'm getting somewhere now. I configure it so that I can see the XP computer and the XP computer can access my files, however when they are opened (a document file) it is read only permissions. I need XP to be able to edit these files too. I opened up the users under system settings and there already was a user created with the XP us/pw. I changed it's group and everything to be included in my group. Although I don't have a good understanding of all that, I think I'm getting closer. I would like to understand it too though. Thanks.

                    Shane
                    Shane, if you have reached that area where you can access the files, there's no need to go back to editing config files. As gypsy pointed out, the developers of Kubuntu have gone through great strides to simplify the process. Here's the easiest way.

                    1. Go to the folder where you are sharing. Say it's /home/MyDocuments (this is just an example).

                    2. Right click on that folder and chose properties.

                    3. Go to the tab marked "share" and click configure file sharing.

                    4. It will prompt you for your 'root' or 'sudo' password. Enter it.

                    5. You'll see a box like the screenshot attached. (sorry, darn attachments isn't working) so I'll try using a link. Hope it works. http://web.omnidrive.com/APIServer/p...creenshot1.png

                    6. The folder in question should be already there. Click on it and chose change on the right hand side. Make sure the box "Writeable" is checked. Click ok and close.

                    That will do the trick.

                    Note:You can use this same method to share any amount of folders that you want shared.


                    By the way, this is totally non-related to the current post, but why is the attachment system not working? Lately, everytime I try to attach a screenshot, I get an error message saying that it's full and to reduce my file size. Largest filesize is 128kb. My screenshot was 63kb
                    Challenges are what that keeps us from the borderline of boredom in life's journey. Linux user no. 419401 currently running Kubuntu 24.04
                    _______________________________________________
                    Current System: Beelink Mini PC, AMD Ryzen 7 5800H 8 Core(Up to 4.4GHz), 32GB DDR4 RAM 1TB NVME M.2 SSD, SER5 MAX Mini Desktop Computer with TCL BeyondTV5 serving as my monitor. ​

                    Comment


                      #11
                      Re: Fiesty & Windows XP = Samba

                      I just noticed your post. If I understand you correctly, there is already a Kub user that is the same as the Samba/XP user? But that Kub user is different than "shane"?

                      Assuming that's the case, then let's call the Samba/XP user "TOM" and let's call your user "SHANE"

                      Like I just said, your smb.conf file has a create file mask of 644, which means the user SHANE can read/write, but other users that only share the same group as SHANE can only read. Same for the "everyone else" category. This would explain why your XP user can see but not modify any of the files.

                      Assuming that you want to keep the two different users SHANE and TOM, then first you need to change that "create file mask" to at least 664, AND make sure that TOM and SHANE are in the same group.

                      But that only takes care of Samba. You must also look at the Kub permissions on the shared folder. These may be different from what you set up in Samba. In other words, you may configure Samba to hand out r/w permissions to a user for a folder, but that user may still only have read only perms in Kub for that folder. This is often the case when you share a folder in a HOME folder with a Kub user other than the one who owns that HOME folder. So take a look (in Konqueror or Konsole) at what the user perms are for that folder.

                      Comment


                        #12
                        Re: Fiesty & Windows XP = Samba

                        And what Princey said. I'm a big fan of avoiding manual edits to config files unless you can't avoid it. I would definitely try to use the way the Kub devs set up.. . .

                        Comment


                          #13
                          Re: Fiesty & Windows XP = Samba

                          Ok guys, thanks a billion for the quick help! Ok, I'm done with config editing. I don't mind editing config files because I do like to know what is going on under the hood just that curiosity in me. Fixed the Samba permissions via the config file, and put TOM into my group, I actually really edited via the GUI the TOM user so that his home directory is the same as mine, and he is included in my group (shane). I also have went to the permissions on the shared folder and made them writable (I think) with the GUI. I'm not as familiar with the KDE GUI, but I'm really starting to like it. If I keep tinkering around I should be able to get it from here. It is mostly just playing with the permissions and getting them set right. I appreciate the help! If I run into any other problems I will post back. Thanks again!

                          Shane
                          John 3:16 - For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

                          Comment


                            #14
                            Re: Fiesty & Windows XP = Samba

                            ok, that did it!!! I can read/write, and everything I need to do. Not sure I could write a how-to on it, but it is working. Thanks.

                            Shane
                            John 3:16 - For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

                            Comment


                              #15
                              Re: Fiesty & Windows XP = Samba

                              Glad to help.

                              Comment

                              Working...
                              X