Windows XP can’t connect to Samba on CentOS 7.x

I have a customer that has two servers, one with CentOS 5.x and Samba 3.x, it was able to connect from all kind of Windows computers to the shared directory by Samba.
However, on a new CentOS 7.x running Samba 4.x, all machines could connect except the ones using Windows XP, and some Windows Server 2003 clients.

The first thing to check was the smb.conf main configuration file, to see if it was identical in both servers, and indeed it was. So, started digging around to see which changes were included in Samba 4.x. One variable was

Add this two lines into your smb.conf main configuration file.

Mine was located at /etc/samba/smb.conf:

nano -w /etc/samba/smb.conf
ntlm auth = yes

Once I added that to the global configuration block inside smb.conf it started working instantly.
This is happening in new versions of Samba starting since Samba 4.5 and higher with has the “ntlm auth” variable set to “no” by default.
On the old Samba 3.x this was set to “yes”.

That’s how the config looks like after the changes:

[global]

        workgroup = AGENCY
        server string = Samba Server %v
        security = user
        passdb backend = tdbsam

        ntlm auth = yes

        encrypt passwords = Yes
        smb passwd file = /var/lib/samba/private/passdb.tdb

        [files2]
        comment = files
        path = /var/www/files2
        public = yes
        writable = yes
        printable = no
        browseable = yes
        available = yes
        valid users = sambauser

If that doesn’t work, try also adding:

lanman auth = yes

Restart samba to apply the changes:

systemctl restart smb

Then check if smb is working fine:

systemctl status smb

And the final test: try to connect from a Windows 2003 client or Windows XP computer.

About the Author: Martin Keler

Leave a Reply

Your email address will not be published. Required fields are marked *