Cannot get samba to work properly

Latest response

I have newly installed RHEL 7.2 Server on an HP ProLiant DL980 server and am having a terrible time getting Samba up and running.

To be more specific, I have smb and nmb services up and running but the sharing process is not working.

It also seems sporadic - sometimes I can see my Windows shares from the Linux machine but other times see nothing. I have at least once been able to connect and move files from Spock (Linux machine) to Kirk (Windows 10) but not it is not there any more. I have never been able to see my Linux shares from the Windows machine no matter what I've tried. I have confirmed that all the machines are in a workgroup called WORKGROUP.

I have disabled SELinux. I may re-enable it at some point, but right now I want to remove it as a possible source for the problems for this and other areas.

I have attached my sbm.conf for your reading pleasure.

Attachments

Responses

Hello Scott,

after cleaning up your smb.conf file, I can say the following:

1.) You're having two [global] sections. Please merge them. 2.) Avoid periods in NetBIOS names. It's an allowed character, but Microsoft recommends not to use it (https://support.microsoft.com/en-us/kb/226144). Windows may treat it as a DNS name. 3.) You have set up an standalone server. I was first a bit confused, because you configured a [netlogon] share, too. However, this isn't a problem. I only wanted to make sure, you expected this setup to be a standalone Samba server.

When you say "...sometimes I can see my Windows shares from the Linux machine but other times see nothing.": - how are you trying to access the Windows share from Linux? - what error is displayed when the connection fails? - any firewalls involved?

Regards, Marc

Hi Marc,

Thanks for the tips on the smb.conf file. I consolidated the [global] sections into one and commented out the [netlogon], which I don't believe is needed.

I have, for purposes of troubleshooting, turned off both the Linux firewall (firewalld) and the Windows firewall (Windows Defender). Once we figure out what is going on, I'd like to turn them back on, as I don't think turning them off is good practice.

At the present time, I can see my Windows shared from RHEL and copy to and fro without any issue. I can also now SEE the shares by browsing the network and opening the "WORKGROUP" workgroup.

However, Windows 10 can still not see my Linux shares. When I try to connect using net use y: \\ipaddress\sharename I get an error. It asks for network credentials but no credentials I try, whether for the Windows 10 machine, windows network logon (Hotmail account), the Linux username and password, OR the samba username and password. It will not accept any of them.

I can ping each machine from the other with no problem.

Thanks!

Scott

Hi Marc,

An update. I decided to delete my samba user and recreate it, which indicated to me that the user was not there at all, which was a surprise to me, since I would have sworn I had created it. In any case, I created a samba user, which coincidentally has the same username and password as my Windows login AND my Linux login. I'm not sure what difference this makes (it shouldn't make any) but I wanted to cover all my bases.

I still cannot see any Linux shares from Windows 10 but I can see Windows 10 shares from Linux and connect to them. I can also connect directly from Windows 10 to Linux using y:\Spock\sharename and make this persistent. I turned on the Windows firewall, rebooted, and it still works. I turned on the Linux firewall and it stopped working, but a bit of tweaking in the firewall-config tool opening up some ports and it now works. Spock is busy at the moment, so I have not rebooted it to see if everything still works OK after reboot.

By brute force, then, I can now mount the shared drives on each system on the other system.

What I cannot do, and I believe should be able to do is to BROWSE the Linux shares from Windows 10. Even with both firewalls off, I do not see Spock on the network, though again the shares work.

Thanks!

Scott

Hi Scott,

it's not necessary to set the same credentials on Windows and Linux. However you have to authenticate, because you are using the default (Never) for the smb.conf file parameter "map to guest". If you don't have a Samba user added, you are not able to log in.

By the way: In the Linux host's firewall you have to open the following ports: 135/tcp, 137/udp, 138/udp, 139/tcp, 445/tcp.

To be able to browse the shares: Can you add "map to guest = Bad User" to the [global] section of your smb.conf, restart Samba, and try accessing accessing \linux-ip\

Regards, Marc

Hi Marc,

Well, there is some progress. By brute force, I now have Spock's (RHEL) shared drives permanently mounted on Kirk (Windows 10) and vice versa. To be fair, Spock can browse and connect to Kirk's drives no problem now, though I had to do some fancy footwork to mount the drives and make them persistent on reboot.

I can browse Kirk's Windows 10 shares from Spock but I cannot browse Spock's Linux shares from Kirk, no matter what I have tried.

I have adjusted the Windows firewall and the Linux firewall but to no effect. Both firewalls are now operating and the shares persist.

Adding "map to guest = Bad User" had no effect on my ability to see the Linux shares from Windows.

All the Best,

Scott

P.S. My latest smb.conf is attached.

P.P.S. What would you think about trying the 4.5 release candidate for Samba? I would have to build the package from source.

Hi Scott,

can you list the shares of the Linux host on itself?

$ smbclient -L localhost -Uuser_name

By the way: Do you connect to the host using the IP (\ip) or using the host name (\host_name)?

What is the error message when you try to list the shares using \ip\ ?

The following is the smb.conf of a standalone server I'm using since several years at home. I haven't tried it with Windows 10, but listing the shares on a Windows 7 and 8.1 works.

[global]

        netbios name = Demo
        server string =
        workgroup = WORKGROUP

        log file = /var/log/samba/%m.log
        log level = 1

        map to guest = Bad User
        passdb backend = tdbsam:/etc/samba/private/passdb.tdb

        load printers = no
        printing = bsd
        printcap name = /dev/null
        disable spoolss = yes

If you run a different version than the one shipped with RHEL, Red Hat won't provide updates nor support. Anyway 4.5 doesn't make a difference in your situation, because browsing the shares on a standalone server works in all Samba version.

systemctl status smb

Sep 01 14:04:26 Spock.RHEL systemd[1]: Starting Samba SMB Daemon...

Sep 01 14:04:26 Spock.RHEL systemd[1]: smb.service: Supervising process 39204 which is not our child. We'll most likely not notice when it exits.

Sep 01 14:04:26 Spock.RHEL smbd[39204]: [2016/09/01 14:04:26.829646, 0] ../lib/util/become_daemon.c:124(daemon_ready)

Sep 01 14:04:26 Spock.RHEL smbd[39204]: STATUS=daemon 'smbd' finished starting up and ready to serve connections

Sep 01 14:04:26 Spock.RHEL systemd[1]: Started Samba SMB Daemon.

systemctl status nmb

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: [2016/09/01 14:04:51.951396, 0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: *****

Sep 01 14:04:51 Spock.RHEL nmbd[39356]:

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: Samba name server SPOCK is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.169

Sep 01 14:04:51 Spock.RHEL nmbd[39356]:

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: *****

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: [2016/09/01 14:04:51.951617, 0] ../source3/nmbd/nmbd_browsesync.c:354(find_domain_master_name_query_fail)

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: find_domain_master_name_query_fail:

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: Unable to find the Domain Master Browser name WORKGROUP<1b> for the workgroup WORKGROUP.

Sep 01 14:04:51 Spock.RHEL nmbd[39356]: Unable to sync browse lists in this workgroup.

please check your fstab file if any errors samba not work properly.

please add samba service in firewall and reload the service.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.