Announcement

Collapse
No announcement yet.

struggling to access samba shares from an xp machine.

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

    struggling to access samba shares from an xp machine.

    Hi all

    I have just started to use Linux and im very impressed, unfortunatly i have hit a bit of a roadblock with samba sharing. I can access shares setup on my xp machines no problem but when I try and create a local share and access it from windows it wont let me in.

    I can see the samba server under windows and access it but when I try and get into the specific shares it gives me a permissions error. It doesnt however ask for any credentials, it just wont let me in!

    I have edited the smb.config file to try and resolve this, but all I have managed to do is get it to a stage where it will sometimes ask for a password. Im not sure what I did or how to turn it back on though .I havent a clue what to put in there though even when its there. i have tried just my linux username and password and also machinename\username and password. I have even tried creating a new account just to see if that would work, it didnt.

    I have checked the access list for the shares and manualy added my linux account to the users but still no access.

    The only thing I can find that is odd is that my Kubuntu machine isnt on the same workgroup as my XP machines, unfortunatly I dont know how to change this under linux, but even so it shouldnt stop samba should it?

    any advice or help is greatly appreciated, thank you.

    #2
    Re: struggling to access samba shares from an xp machine.

    Go here and get this manual; http://samba.org/samba/docs/man/Samba-Guide/
    This is straight from the horses mouth and has example configurations that you can copy/paste and modify to suit.

    First up I am going to assume that you have installed the full samba, not just smbfs.
    I would say that your problems stem from not having added samba users and passwords on your linux machine.
    Essentially, this takes the windows authentication that your windows box is passing, and maps it to a local user's permissions on the linux machine.

    For the workgroup settings check in the global settings at the top of your smb.conf file. You should see something like this;

    # Change this to the workgroup/NT-domain name your Samba server will part of
    workgroup = MSHOME

    Here is the relevant part of my smb.conf file for the shared directory;

    [Media]
    path = /media/UbuntuShare/Media
    available = yes
    browsable = yes
    public = yes
    guest ok = yes
    writable = no

    [WorkingDirectory]
    path = /media/Working/WorkingDirectory
    available = yes
    browsable = yes
    public = yes
    guest ok = yes
    writable = yes

    Change to suit your share paths. This is browseable by anyone, first directory is read only, second is read write.
    The second has sub folders with user specific permissions applied, ie, my daughter Violet can read and write in the folder /media/Working/WorkingDirectory/Violet but no one else can.

    The below is from a guide on the ubuntu forums https://help.ubuntu.com/community/SettingUpSamba

    Add users who can access your shares with the 'smbpasswd' command.
    sudo smbpasswd -a username
    New SMB password:
    Retype new SMB password:
    Added user username.

    NOTE: the username used here should be a real user setup on your PC/Server.

    Reload Samba after every change to users/passwords or 'smb.conf'
    sudo /etc/init.d/samba reload

    The samba reload can take two or three minutes so be patient.
    Don't just assume that it hasn't worked and go in and change it again.

    Also, before you edit any of your configuration files manually MAKE A BACKUP COPY!
    Just a simple save as blahblah.bak can and will save you so much pain.
    You don't need a license to drive a sandwich.

    Comment


      #3
      Re: struggling to access samba shares from an xp machine.

      ok thanks for the reply, but im still having that problem. I think there may be an issue with my samba install itself.

      When I try and get to the shares from my windows machine, it finds the server, can see the shares but when I try and open them it gives me a no permissions error. It doesnt even prompt for a password or anything. Thats with the exact same config in smb.conf that is posted above.

      Also im now struggling to get to my shares on my windows pc from within linux. It does find it eventualy, but it is working very very slowly. For instance I cant opening a shared folder takes about 30seconds instead of instant as it was. I know its not a hardware issue as I have my machine dual booting xp and it works fine under windows.

      Is there a setting I can change in samba to insist that windows prompts for a password/UN when accessing shares in linux. And is there any way of totaly re-installing samba, removing every trace of it and starting a fresh?

      Comment


        #4
        Re: struggling to access samba shares from an xp machine.

        You might gain some insight from this Basic Samba Setup for a Home Fileserver
        Using Kubuntu Linux since March 23, 2007
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: struggling to access samba shares from an xp machine.

          ok im still having real trouble here!

          I have setup samba exactly as described but still cant get to the shares. I can see the server in my workgroup, i can see the shares within it but as soon as I try and open them I get an access error. I haven't a clue what im doing wrong. I setup the share exactly the same as the one in the tutorial thats meant to utterly insecure. I have set the global share security to share instead of user, got everything in one workgroup, turned on guest and public access for the shares, I even tried totally removing samba and re-installing it. Im running out of ideas!

          please can someone tell me the answer! I will be forever grateful this is bugging the hell outta me!

          Comment


            #6
            Re: struggling to access samba shares from an xp machine.

            I had the same issue.
            I have not actually fixed that myself yet and still cannot browse to the share.
            I can however map to it.

            Basically, what I have done to get the access is first to set my server on a static ip address.
            Second, from windows, use the map network drive tool from the tools menu.
            In the folder box type the absolute path of the share. In my case \\192.168.1.3\Media

            My systems would for some unknown reason not resolve the host name, but the absolute path (ip address) works fine.

            Windows authentication maps to the local user fine for me too.

            Mapping the drive is more convenient too, in the same way that mounting shares at boot is for Linux.
            Remember too that it can take several minutes for changes to samba to take effect.

            Just another helpful hint too, when setting a mapped network drive in windows leave a couple of drive letters between your last physical drive and your first network drive.
            This is because when you attach a removable device windows will try to mount it to the next drive letter after your last physical drive.
            If there is a network drive in the next space it will still try to mount it there, but it will be inaccessible and invisible.
            This will leave you having to go into the management console to reallocate the drive letter for your removable medium.
            It is much less hassle just to leave a couple of drive letters free before your first network drive.
            You don't need a license to drive a sandwich.

            Comment


              #7
              Re: struggling to access samba shares from an xp machine.

              Thanks for the reply, I will try that as soon as I get to my pc. I didnt try using the ip to connect, pretty stupid of me I know but still. I will try and map the drive and see what comes up. I knew about thw indows drive letter issue too, its so very annoying. I like to try and keep my drives in order is possible but i cant now because of that so I have to have network drives starting from z:

              Comment


                #8
                Re: struggling to access samba shares from an xp machine.

                Ok I have had a look at that and in getting nowhere with it. I have done some more research online about this and it seems to be a major issue, but no-one has a good answer! The suggestions here are the suggestions that are all over the net (ie change smb.conf, run smbpasswd etc) but nothing seems to work. This is the same for everyone I have seen threads from, no one has ever gotten to the bottom of the problem!

                So in an attempt to sort this heres the position:

                I can see and access my server from xp in network places/unc path but I cannot go any further than the top level without an access permissions error. However I have noticed that WINDOWS DOES NOT DIFFERENTIATE BETWEEN AN ACCESS ERROR AND AN INABILITY TO FIND THE SHARE! so what im thinking is that its not able to read the share. Now I know this is going to sound dense but what file system does linux use for the shares? do I have to specify that it needs to use a windows readable FS? I cant imagine this being the case but it would explain a lot!

                I also know now that its not an smb.conf issue because this is the entirity of my smb.conf file!
                Code:
                [font=Verdana]
                [global]
                workgroup = Mshome
                netbios = jonathan1
                
                [test]
                comment = For testing only
                path = /home/jonathan/Desktop/completed/
                read only = no
                guest ok = yes
                admin users = jonathan
                case sensitive = no
                strict locking = no
                msdfs proxy = no
                [/font]
                its also not an issue with the user not being a samba user or I wouldnt be able to get onto the sever at all.

                The more I check the more I am 100% sure that windows just cant read the share, its not an issue of access. If I try and map the drive using correct credentials, it doesnt give the standard permissions error it says path doesnt exist even though it does.

                Im really hoping I can get an answer to this problem, because it seems to be pretty widespread but un-solvable!

                [edit] thought this might be usefull, the contents of my samba log regarding the client I was trying to connect from, looks like its just refusing the connection?
                Code:
                [2007/11/28 18:48:41, 0] smbd/service.c:make_connection(1191)
                 jonathan4 (192.168.2.104) couldn't find service completed
                [2007/11/28 18:48:41, 0] smbd/service.c:make_connection(1191)
                 jonathan4 (192.168.2.104) couldn't find service completed
                [2007/11/28 18:48:43, 0] smbd/service.c:make_connection(1191)
                 jonathan4 (192.168.2.104) couldn't find service completed
                [2007/11/28 18:48:46, 0] smbd/service.c:make_connection(1191)
                 jonathan4 (192.168.2.104) couldn't find service completed
                [2007/11/28 18:48:46, 0] smbd/service.c:make_connection(1191)
                 jonathan4 (192.168.2.104) couldn't find service completed
                [2007/11/29 12:12:28, 0] lib/util_sock.c:write_data(562)
                 write_data: write failure in writing to client 0.0.0.0. Error Connection reset by peer
                [2007/11/29 12:12:28, 0] lib/util_sock.c:send_smb(769)
                 Error writing 4 bytes to client. -1. (Connection reset by peer)
                [2007/11/30 18:07:37, 0] lib/util_sock.c:read_data(534)
                 read_data: read failure for 4 bytes to client 192.168.2.104. Error = Connection reset by peer
                hope that helps a bit.
                [/edit]

                Comment


                  #9
                  Re: struggling to access samba shares from an xp machine.

                  As far as the file system goes that does not matter.
                  I have no problems connecting and reading/writing from my XP box to a share on my Ubuntu server that is ext3 file system.
                  The server is hosting the file system, so as long as the server can read and write it can distribute the data to clients.

                  Do you have any firewalls running?
                  Under XP you need to enable file sharing etc, the easiest way is to run the network setup wizard from the network connections folder.
                  If you are running firestarter on your server you will need to add a rule to the inbound traffic policy.
                  For my network this allows connections from host 192.168.1.1/24
                  The /24 part means that it allows connections from 192.168.1.1 - 255 ie my whole subnet branch.
                  Add an entry to allow service, Samba (SMB) on port 137-139 445 for everyone.

                  Many of my early failures were because of the firewalls I am running.

                  The error codes you have there look to me like the connection is being blocked, but I am no expert on the mystical insides of the system.
                  Can someone else out there comment on the errors?

                  Have you checked your /etc/samba/smbusers file?
                  It should look like this, but with your user names:

                  barry = "barry"
                  sharon = "sharon"
                  amber = "amber"
                  jareth = "jareth"
                  isaac = "isaac"
                  violet = "violet"

                  Basically here, windows says hi this is barry to samba, samba then says ok, barry is local user "barry"
                  Sorry if this is getting frustrating, I know it did for me.
                  I am trying to remember all the hoops that I had to jump through.
                  That samba3 by example was the one that helped me to crack it, and is probably the best resource out there being official samba documentation by the guys who develop samba.

                  Don't forget to restart samba, and give it 5 or 10 minutes to restart.
                  I know it is bloody hard to just walk away from it for that long while it resets itself, but you will not know for sure if the changes made did it unless you give it that time before trying something else.
                  You don't need a license to drive a sandwich.

                  Comment


                    #10
                    Re: struggling to access samba shares from an xp machine.

                    Hey, brilliant, I think I may have just noticed what is wrong with you smb.conf file


                    [global]
                    workgroup = Mshome
                    netbios = jonathan1

                    [test]
                    comment = For testing only
                    path = /home/jonathan/Desktop/completed/
                    read only = no
                    guest ok = yes
                    admin users = jonathan
                    case sensitive = no
                    strict locking = no
                    msdfs proxy = no


                    See in the path /home/jonathan/Desktop/completed/
                    The last / should not be there. It is trying to share a directory one level below completed that has no name.

                    Change it to /home/jonathan/Desktop/completed and that should take care of it.
                    You don't need a license to drive a sandwich.

                    Comment


                      #11
                      Re: struggling to access samba shares from an xp machine.

                      Have a look at this working smb.config as a reference:


                      [global]

                      workgroup = FINTANHOME
                      interfaces = eth0
                      map to guest = bad user

                      [Data]

                      path = /Data
                      read only = no
                      guest ok = yes
                      case sensitive = no
                      strict locking = no
                      force user = fintan



                      [HP4200]

                      printing = cups
                      path = /var/tmp
                      printable = yes
                      guest ok = yes
                      guest only = yes
                      This is a no password config as I am alone on this (vmware )network but you can change tha to your liking.

                      I did notice two things though:

                      Under Gutsy (or maybe the latest samba) the line:
                      force user = xyz
                      is necessary.

                      The line:
                      msdfs proxy = no
                      gave me a lot of headaches in the past on feisty and edgy. Comment that line out. It is a bug from the GUI configuration.

                      I hope this helps point you in the right direction
                      HP Pavilion dv6 core i7 (Main)
                      4 GB Ram
                      Kubuntu 18.10

                      Comment


                        #12
                        Re: struggling to access samba shares from an xp machine.

                        Thank you!!!!!!!!!!!!!!

                        thanks so much! its working! It took a hell of a lot but i can get to the shares now. I edited the smb.conf with all the tips you guys suggested, and i'm not sure which one of them made it start working but something did! For anyone else who is having this issue this is the smb.conf I ended up with and it WORKS!

                        Code:
                        [global]
                        workgroup = Mshome
                        
                        
                        [test]
                        comment = For testing only
                        path = /home/jonathan/Desktop/completed
                        read only = no
                        guest ok = yes
                        admin users = jonathan
                        case sensitive = no
                        strict locking = no
                        :msdfs proxy = no
                        locking = no
                        max connections = 2
                        force user = jonathan

                        Comment


                          #13
                          Re: struggling to access samba shares from an xp machine.

                          I swear, if my problem turns out to be "msdfs proxy"!!!!

                          Comment


                            #14
                            Re: struggling to access samba shares from an xp machine.

                            forgive my newbieness but what is msdfs proxy? I have commented it out, but what does it do.

                            also im still having some issues. I can connect through samba now but its really really unstable. It will be fine for a while then it will just stop letting me in, or at least go amazingly slowly. That makes it pretty much useless as I wanted to stream video to my media center downstairs using this. I can fix it for a while by re-starting samba on the linux box but its a real pain having to do it all the time. I doubt theres realy a "fix" as such for this, but any suggestions of what could be causing the instability. oh and is there any way of getting to a console windows from my xp box, like telnet kinnda thing? so if i do have to reset samba I dont have to run upstairs all the time?

                            Comment


                              #15
                              Re: struggling to access samba shares from an xp machine.

                              You can enable remote desktop on your server and install vnc or tightvnc on your xp box but don't set the vnc server to start with windows. I had so many strange connection attempts to my machine that I ended up removing it, but then you could also block the port used from your router.
                              Sorry but I can't remember where to turn on remote login, Fintan?
                              Can't help with the stability, mine is like a rock and I stream video to two or three PCs at once.
                              You don't need a license to drive a sandwich.

                              Comment

                              Working...
                              X