Results 1 to 10 of 10

Thread: 11.10 - Can't connect to samba from windows machine

  1. #1
    Join Date
    Sep 2007
    Beans
    584
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Question 11.10 - Can't connect to samba from windows machine

    I'm trying to connect to my linux machine from my windows machine. Unfortunately, I'm unable to do that.

    I installed the samba server, and tried sharing a folder "/home/dino/blah" via the GUI. I'm unable to connect to it, any any changes I make to it via the GUI don't stick.

    I tried editing smb.conf and reloading the samba service, but I still cannot connect.

    Either way, when I'm prompted to enter my user and pass on the windows machine, I enter my credentials and it tells me they're incorrect.

    What am I missing here?

    Code:
    [blah2]
       browseable = yes
       path = /home/dino/blah
       valid users = dino
       public = yes
       writable = yes
       read only = no

  2. #2
    Join Date
    May 2008
    Location
    Berks, UK
    Beans
    1,387

    Re: 11.10 - Can't connect to samba from windows machine

    I suspect that what you have is a problem because Samba and linux each have their own password arrangements. The smb.conf should have some lines relating to where the passwords are kept, and the method of encrypting.
    If you're using user passwords under samba, I set up the password table with a samba utility (see documentation, as I don't remember - having been in the habit of copying the vital bits when setting up new linux installs)

    HTH
    Derek

  3. #3
    Join Date
    Sep 2007
    Beans
    584
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: 11.10 - Can't connect to samba from windows machine

    Here's what I Have set for authentication:

    Code:
    ####### Authentication #######
    
    # "security = user" is always a good idea. This will require a Unix account
    # in this server for every user accessing the server. See
    # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
    # in the samba-doc package for details.
       security = user
    
    # You may wish to use password encryption.  See the section on
    # 'encrypt passwords' in the smb.conf(5) manpage before enabling.
       encrypt passwords = true
    
    # If you are using encrypted passwords, Samba will need to know what
    # password database type you are using.  
       passdb backend = tdbsam
    
       obey pam restrictions = yes
    
    # This boolean parameter controls whether Samba attempts to sync the Unix
    # password with the SMB password when the encrypted SMB password in the
    # passdb is changed.
       unix password sync = yes
    
    # For Unix password sync to work on a Debian GNU/Linux system, the following
    # parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
    # sending the correct chat script for the passwd program in Debian Sarge).
       passwd program = /usr/bin/passwd %u
       passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    
    # This boolean controls whether PAM will be used for password changes
    # when requested by an SMB client instead of the program listed in
    # 'passwd program'. The default is 'no'.
       pam password change = yes
    
    # This option controls how unsuccessful authentication attempts are mapped
    # to anonymous connections
       map to guest = bad user

  4. #4
    Join Date
    Sep 2007
    Beans
    584
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: 11.10 - Can't connect to samba from windows machine

    setting security = share made the directory 'blah2' visible. Then I removed 'valid users = dino' and I got right in without a password...wtf.

  5. #5
    Join Date
    May 2008
    Location
    Berks, UK
    Beans
    1,387

    Re: 11.10 - Can't connect to samba from windows machine

    Not quite sure how you pass the checks with this - certainly not without all the detail. I've always found the per-user share a bit tricky - got it sorted on an old setup which had RedHat6 at one end and Win98 at the other, but the encryption stuff got more complicated later and I ended up finding a fairly open setup which gave access (no local security considerations to worry about).

    Good luck
    Derek

  6. #6
    Join Date
    Jul 2008
    Beans
    84

    Re: 11.10 - Can't connect to samba from windows machine

    You get in without a password because your Windows machine is automatically trying to log in as 'guest', and it succeeds because you don't have this line:

    guest ok = no


    I'd be wary of password sync, and maybe try this:

    1: Comment out the password sync options (all three)
    2: Add 'guest ok = no' to your share
    3: On the linux box, run 'smbpasswd [username]' to assign a samba password
    4: restart samba
    5: restart Windows
    6: reconnect

    (Yes I know it sounds odd to restart windows. You can try it without it, but Windows is very "good" about remembering credentials when you've logged in to a share, and you have logged in as 'guest'. There's a way to tell Windows to forget its credentials and drop its authentication to that server/share, but I forget what it is, and restarting also does it. It's 'sometimes' a problem when you change your smb password. May only happen on a full moon, not sure.)


    NOTE: He's not using per-user share. He seems to be mapping an explicit share directly to his home folder. (Which is fine, it's just not the 'per-user share' you thought it was.)


    ANOTHER NOTE: (experts correct me if I'm wrong, but I'm pretty sure this is right.) I believe you want to use 'security = user'. Understanding this might require having seen the way Windows shares have behaved over the years. Back in the day, it was possible to define a list of usernames and passwords for access on a per-folder basis. This was done on versions of Windows that did not understand the concept of user accounts, or did not understand it in a way that made sense for authentication. That system was 'security = share'. In 'share' security you would share a folder and tell the folder what usernames / passwords to accept. In your situation, I think you want this instead:

    1: security = user
    2: Use smbpasswd to supply a samba password
    3: Log in with your unix account name and the special Samba password.


    Also, if you're having problems with password sync, it looks like the actual password sync only occurs when you *change* your password. You could try keeping password sync and changing your unix password to 'baconmunch' and then back to whatever it was before. That should trigger an automatic reset of your Samba password (to 'baconmunch' and then back to original). Just remember you still have TWO passwords being stored, and also note that if the samba password storage is less secure than your main password storage, you are making your password slightly less secure because gaining your Samba password also gains someone your Unix account. (And thus, root on your system via sudo.)
    Last edited by misterbk; March 4th, 2012 at 07:39 PM. Reason: clarity

  7. #7
    Join Date
    Jul 2008
    Beans
    84

    Re: 11.10 - Can't connect to samba from windows machine

    BTW, I just got mine working on a fresh install of kubuntu.

    One hiccup was the lack of an initial samba password for my user account. smbpasswd run from that account gave 'NT_STATUS_LOGON_FAILURE' because I had to enter my nonexistent old password. (May be a commandline option around it, but this is easier if it's your machine and you have sudo):

    To fix this:
    1) sudo su -
    2) smbpasswd [username]
    3) enter the new password. You're done.

  8. #8
    Join Date
    Jun 2008
    Location
    Malaysia
    Beans
    140
    Distro
    Ubuntu 12.04 Precise Pangolin

    [SOLVED] Re: 11.10 /12.04 - Can't connect to samba from windows machine

    +1 To this
    Quote Originally Posted by misterbk View Post
    BTW, I just got mine working on a fresh install of kubuntu.

    One hiccup was the lack of an initial samba password for my user account. smbpasswd run from that account gave 'NT_STATUS_LOGON_FAILURE' because I had to enter my nonexistent old password. (May be a commandline option around it, but this is easier if it's your machine and you have sudo):

    To fix this:
    1) sudo su -
    2) smbpasswd [username]
    3) enter the new password. You're done.
    Code:
    ~$ sudo smbpassword [username]
    ~$ [hidden password]:
    But can someone add this fix to samba installation script and not that we have to punch this every distro update.
    Last edited by FirstByté; May 21st, 2012 at 05:06 AM. Reason: Marking SOLVED
    "The collection of people, hardware, and software --Internet.
    Let us assume for a moment that such a network has been formed." - J. C. R. Licklider, Robert Taylor, 1968.
    Linux Registered User #511228! Ubuntu Registered User #31414

  9. #9
    Join Date
    May 2006
    Beans
    18

    Re: 11.10 - Can't connect to samba from windows machine

    Samba Server and Windows machine isn't very difficult with a simple little tool called System-Config-Samba a simple Graphical Samba tool.

    Once you install it with your favorite package manager it will be listed in your menu as “Samba”. Some versions you will get an error saying KDEInit could not launch 'gksu' Could not find 'gksu' executable. Don't worry like I did it's only a little glitch. Just means you have to go to a Terminal and type “Sudo system-config-samba” then enter the root password. I'm sure there is a more complicated way to fix it...but I don't know it.

    Once you get it up and running, set up a new Samba User and password from the drop down menu. Then click the green + icon and browse the folders to your desired share folder.

    Once folder is selected you can set a name for your share that will show up on all other computers.
    You will also have to setup the permissions for access, being write or read only.

    Then click the tab labeled Access this is where you select who can access the share, a user from the list(your new user should be listed) or select Everyone. If you select a user, that will require a username and password to be entered to access the shared folder.

    Once you click OK your share should be listed and shared. You also have to make sure your permissions are set correctly for the actual shared folder and the files. For example if your Samba share says everyone can access, but the actual file permissions say read only then your gonna have a problem. If you make changes to your Samba share, they likely won't be immediately initiated. Sometimes you have to restart the Samba server or logoff the client machine then login again to get the changes.

    I have used System-Config-Samba currently on Kubuntu 12.10 Alpha, Linux Mint 13(12.04) and earlier versions of Kubuntu.

  10. #10
    Join Date
    May 2006
    Beans
    18

    Re: 11.10 - Can't connect to samba from windows machine

    The above post of mine was made on a completely different thread. Apparently the mods are picking and choosing to drop posts into random threads as they feel like it. The post was a reply mostly to a question by a previous poster, but also a related topic of the original thread, but the mods didn't like it. WTH!!!




    But another possible fix that I found wasn't on the Samba side it was the Windows side(big surprise I know). Here is the fix



    Otherwise another issue with Win7 and Vista is fixed with this info I found after hours of researching. Only to find a couple simple little fixes.

    Basically, you have to add a DWORD value called LmCompatibilityLevel to:

    HKLM|System|CurrentControlSet|Control|Lsa and set the value to 2.
    LmCompatibilityLevel



    Explanation:

    HKLM\SYSTEM\CurrentControlSet\Control\Lsa
    Data type
    Range
    Default value

    REG_DWORD
    0–5
    0


    Description

    Specifies the mode of authentication and session security to be used for network logons.
    Value
    Meaning

    0
    Clients use LM and NTLM authentication, but they never use NTLMv2 session security. Domain controllers accept LM, NTLM, and NTLMv2 authentication.

    1
    Clients use LM and NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication.

    2
    Clients use only NTLM authentication, and they use NTLMv2 session security if the server supports it. Domain controller accepts LM, NTLM, and NTLMv2 authentication.

    3
    Clients use only NTLMv2 authentication, and they use NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication.

    4
    Clients use only NTLMv2 authentication, and they use NTLMv2 session security if the server supports it. Domain controller refuses LM authentication responses, but it accepts NTLM and NTLMv2.

    5
    Clients use only NTLMv2 authentication, and they use NTLMv2 session security if the server supports it. Domain controller refuses LM and NTLM authentication responses, but it accepts NTLMv2.
    Activation method

    You must restart Windows to make changes to this entry effective.

    Note

    To set a client running Windows NT Service Pack 4 to level 3 security or higher, the domain controllers for the user's account domains must already be upgraded to Service Pack 4.

    For more information about operating-system interoperability and session security settings , see the Microsoft Knowledge Base link on the Web Resources page. Search the Knowledge Base for Article Q147706 or for the keywords LM authentication.






    **** For inability to access password share as standard user

    to configure the EnableLinkedConnections registry value
    Click Start, type regedit in the Start programs and files box, and then press ENTER.
    Locate and then right-click the registry subkey

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Policies\System.

    Point to New, and then click DWORD Value.
    Type EnableLinkedConnections, and then press ENTER.
    Right-click EnableLinkedConnections, and then click Modify.
    In the Value data box, type 1, and then click OK.
    Last edited by megamister; September 15th, 2012 at 02:49 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •