SOLVED: SMB not working (ports 139 and 445 not listening)

FTP Server, File Server, DDNS, SAMBA, AFP, NFS
Post Reply
Dormi
New here
Posts: 8
Joined: Wed Jun 08, 2016 4:40 pm

SOLVED: SMB not working (ports 139 and 445 not listening)

Post by Dormi »

I got a TS-221 here.

I is mainly used for Backups running over iSCSI. But I also have some regular windows shares. For a certain time these shares are not reachable anymore.
I can access them using the web interface but not using Windows Explorer

So i digged into this a little bit and found out that the smb ports 139 and 445 are not listening

I allready disabled and enabled Microsoft network in the gui and of course I rebooted the system multiple times. And also did 2 firmware updates (now 4.3.3.0238)

Restarting the smb service looks like this:
[/etc/init.d] # ./smb.sh restart
Restarting SMB services:
Shutting down SMB services: smbd smbd-notifyd cleanupd nmbd.
Shutting down winbindd services: winbindd.
locks path was set to /share/HDA_DATA/.locks
Shutting down winbindd services: winbindd.
Starting winbindd services:Starting SMB services:.
done.

is that as it is supposed to be?

What else could cause that behaviour?

Thanks in advance.
Last edited by Dormi on Fri Jul 28, 2017 9:37 pm, edited 1 time in total.
User avatar
Trexx
Ask me anything
Posts: 5388
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: SMB not working (ports 139 and 445 not listening)

Post by Trexx »

Have you opened a Helpdesk ticket with QNAP? There have been some post on the boards with some users experiencing SMB related problems (especially in Marvel based units) with the latest release.
Paul

Model: TS-877-1600 FW: 4.5.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x1TB SK Hynix Gold
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
UPS: CP AVR1350

Model:TVS-673 32GB & TS-228a Offline[/color]
-----------------------------------------------------------------------------------------------------------------------------------------
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq
ssuper2k
Starting out
Posts: 46
Joined: Thu Feb 19, 2015 10:42 pm

Re: SMB not working (ports 139 and 445 not listening)

Post by ssuper2k »

What smb version have you enabled on the qnap?
What smb version on the windows pcs?

I'd suggest use at least smb 2.1 both ways. And disable smb1 for good

Qnap:
smb2status
smb21enable

https://www.qnap.com/en/how-to/tutorial ... in-qts-4-2
viewtopic.php?t=123661

Win81/10

disabling SMB1 server with this:

Set-SmbServerConfiguration -EnableSMB1Protocol $false

It stops ‘servicing’ on SMB1, but SMB1 ‘client’ is still working unless you remove the ‘Feature’:

Remove-WindowsFeature FS-SMB1

https://support.microsoft.com/en-us/hel ... nd-windows
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: SMB not working (ports 139 and 445 not listening)

Post by schumaku »

Dormi wrote:So i digged into this a little bit and found out that the smb ports 139 and 445 are not listening
By rule of thumb SAMBA, specifically smbd not running.

Check the logs:

# cat /var/log/log.smbd
...

# cat /var/log/log.nmbd
...

Post the output pls.
Dormi
New here
Posts: 8
Joined: Wed Jun 08, 2016 4:40 pm

Re: SMB not working (ports 139 and 445 not listening)

Post by Dormi »

Thank you very much for your inputs.
I think we are getting very close to the point:

smb2status indicated that only smb 1.0 is enabled so I enabled 2.1 using the smb21enable command.
The Server is 2008R2 and Win7 Clients by the way.

But even more important looks the log to me:
the log.smbd shows hundreds of entries like this:

SamInfo3_for_guest: Unable to locate guest account [nobody]!
[2017/07/21 08:23:33.909522, 0] ../source3/auth/auth_util.c:826(make_new_session_info_guest)
get_guest_info3 failed with NT_STATUS_NO_SUCH_USER
[2017/07/21 08:23:33.909837, 0] ../source3/smbd/server.c:1815(main)
ERROR: failed to setup guest info.
[2017/07/21 08:24:05.530010, 0] ../source3/auth/auth_util.c:757(get_guest_info3)


So it looks like the guest account can't be found.
I did not find a "how to recreate the guest account" so far.
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: SMB not working (ports 139 and 445 not listening)

Post by schumaku »

Dormi wrote:So it looks like the guest account can't be found.
I did not find a "how to recreate the guest account" so far.
OK, and who has removed the required guest account from the /etc/passwd (and /etc/shadow probably) then please ...?

[~] # cat /etc/config/passwd | grep guest
guest:x:65534:65534:guest:/share/homes/guest:/bin/sh

[~] # cat /etc/config/shadow | grep guest
guest:!:14233:0:99999:7:::

If these don't exist, add the missing one(s) using ...

Code: Select all

echo "guest:x:65534:65534:guest:/tmp:/bin/sh" >> /etc/config/passwd

Code: Select all

echo -e "guest:\x21:14233:0:99999:7:::" >> /etc/config/shadow
Then use ... just for the sake of it:

[~] # passwd guest
Changing password for guest
New password
...
...set any random password...
Dormi
New here
Posts: 8
Joined: Wed Jun 08, 2016 4:40 pm

Re: SMB not working (ports 139 and 445 not listening)

Post by Dormi »

OK, and who has removed the required guest account from the /etc/passwd (and /etc/shadow probably) then please ...?
I did not log in the cli on this device so, I have no clue what went wrong. I don't think that you can accidentialy delete the guest account in the gui.

My outputs were:

[~] # cat /etc/config/passwd | grep guest
guest:x:65534:65534:guest:/share/homes/guest:/bin/sh

[~] # cat /etc/config/shadow | grep guest
guest: (something different than your output. I failed to copy it.

So I did:
echo -e "guest:\x21:14233:0:99999:7:::" >> /etc/config/shadow
and deleted the old vaule from /etc/config/shadow

reboot

nothing changed.
Portscanner still only shows open ports: 21,22,80,443,631,873
log still shows:
[2017/07/22 17:01:35.018412, 0] ../source3/auth/auth_util.c:757(get_guest_info3)
SamInfo3_for_guest: Unable to locate guest account [nobody]!
[2017/07/22 17:01:35.018889, 0] ../source3/auth/auth_util.c:826(make_new_session_info_guest)
get_guest_info3 failed with NT_STATUS_NO_SUCH_USER
[2017/07/22 17:01:35.019164, 0] ../source3/smbd/server.c:1815(main)
ERROR: failed to setup guest info.

I also trried:
[/etc/init.d] # ./smb.sh reinstall_samba keep

but that did not change anything as well.
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: SMB not working (ports 139 and 445 not listening)

Post by schumaku »

Dormi wrote:SamInfo3_for_guest: Unable to locate guest account [nobody]!
Sorry, was not correctly reading the output provided.
Dormi wrote:I did not log in the cli on this device so, I have no clue what went wrong. I don't think that you can accidentialy delete the guest account in the gui.
No, you can't. As well it's not possible to change the SAMBA config to use nobody instead of guest from the Web UI.

[~] # getcfg -f /etc/config/smb.conf global "guest account"
guest <<<< bet you see nobody here

[~] # setcfg -f /etc/config/smb.conf global "guest account" guest
[~] # /etc/init.d/smb.sh restart
Dormi
New here
Posts: 8
Joined: Wed Jun 08, 2016 4:40 pm

Re: SMB not working (ports 139 and 445 not listening)

Post by Dormi »

Thank you very much schmaku! - Problem solved!

That last 2 lines did it!
Post Reply

Return to “File Sharing”