Score:0

Windows 10 Doesn't connect with Samba4 server

tn flag

I'm facing a problem with my samba server. I had a Samba server but it was a very old configuration so I have reinstalled the OS (Debian 5.10.140-1) and the Samba (Samba version 4.13.13). But now all the computers with Win10 cannot connect in the server. I get the message:

The device or resource (nameServer) is not configured to accept connections on the "File and Printer Sharing (SMB)" port.

I Have tried a lot of ways to make it work, but nothing worked. So here's my smb.conf

[global]
    netbios name = SMBSHARE
    server string = Compartilhamento
    workgroup = MYGROUP
    smb ports = 139
    security = user
    wins support = yes
    dns proxy = no
    os level = 100
    auto services = global
    name resolve order = lmhosts, host, wins, bcast
    cups options = raw
    load printers = yes
    interfaces = lo eth1 192.168.1.0/24
    hosts allow = 127. 192.168.1.
    passdb backend = tdbsam
    ntlm auth = yes
    preferred master = yes
    domain master = yes
    logon path = %Nprofile%u
    invalid users = root
    server min protocol = NT1
    #client max protocol = SMB3_11

        ### Log Config ###
    #log file = /var/log/samba/log.%m
    #log level = 5
    #max log size = 500
    #syslog = 5



[printers]
    comment = All Printers
    browseable = yes
    path = /var/spool/samba
    printable = yes
    public = yes
    writable = no
    guest ok = yes
    use client driver = yes


# ============ Shared Directories ===========
[Public]
    comment = Diretorio Publico
    path = /home/share/Public_file
    public = yes
    writable = yes
#   guest ok = yes
    guest only = yes
    browseable = yes
    printable = no
    write list = +staff
    force create mode = 775
    force directory mode = 775

[Private Share]
    comment = Diretorio Compartilhado
    path = /home/share/Private_share
    public = no
    writable = yes
#   guest ok = no
    valid users = adminrh
    force create mode = 770
    force directory mode = 770
    ;inherit permissions = yes

And I have some log from the computer that I'm trying to logging:

[...]
[2022/10/21 16:06:31.009658,  5] ../../lib/util/debug.c:811(debug_dump_status)
  INFO: Current debug levels:
    all: 5
    tdb: 5
    printdrivers: 5
    lanman: 5
    smb: 5
    rpc_parse: 5
    rpc_srv: 5
    rpc_cli: 5
    passdb: 5
    sam: 5
    auth: 5
    winbind: 5
    vfs: 5
    idmap: 5
    quota: 5
    acls: 5
    locking: 5
    msdfs: 5
    dmapi: 5
    registry: 5
    scavenger: 5
    dns: 5
    ldb: 5
    tevent: 5
    auth_audit: 5
    auth_json_audit: 5
    kerberos: 5
    drs_repl: 5
    smb2: 5
    smb2_credits: 5
    dsdb_audit: 5
    dsdb_json_audit: 5
    dsdb_password_audit: 5
    dsdb_password_json_audit: 5
    dsdb_transaction_audit: 5
    dsdb_transaction_json_audit: 5
    dsdb_group_audit: 5
    dsdb_group_json_audit: 5
[2022/10/21 16:06:31.010658,  4] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2022/10/21 16:06:31.010716,  5] ../../libcli/security/security_token.c:52(security_token_debug)
  Security token: (NULL)
[2022/10/21 16:06:31.010741,  5] ../../source3/auth/token_util.c:873(debug_unix_user_token)
  UNIX token of user 0
  Primary group is 0 and contains 0 supplementary groups
[2022/10/21 16:06:31.010782,  5] ../../source3/smbd/uid.c:493(smbd_change_to_root_user)
  change_to_root_user: now uid=(0,0) gid=(0,0)
[...]
[2022/10/21 16:06:32.668102,  5] ../../source3/lib/util.c:188(show_msg)
  size=39
  smb_com=0x74
  smb_rcls=0
  smb_reh=0
  smb_err=0
  smb_flg=24
  smb_flg2=51223
  smb_tid=0
  smb_pid=65279
  smb_uid=41336
  smb_mid=448
  smt_wct=2
  smb_vwv[ 0]=  255 (0xFF)
  smb_vwv[ 1]=    0 (0x0)
  smb_bcc=0
[2022/10/21 16:06:32.668204,  3] ../../source3/smbd/process.c:1548(switch_message)
  switch message SMBulogoffX (pid 348933) conn 0x0
[2022/10/21 16:06:32.668250,  4] ../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2022/10/21 16:06:32.668293,  5] ../../libcli/security/security_token.c:52(security_token_debug)
  Security token: (NULL)
[2022/10/21 16:06:32.668315,  5] ../../source3/auth/token_util.c:873(debug_unix_user_token)
  UNIX token of user 0
  Primary group is 0 and contains 0 supplementary groups
[2022/10/21 16:06:32.668353,  5] ../../source3/smbd/uid.c:493(smbd_change_to_root_user)
  change_to_root_user: now uid=(0,0) gid=(0,0)
[2022/10/21 16:06:32.668393,  5] ../../lib/dbwrap/dbwrap.c:146(dbwrap_lock_order_lock)
  dbwrap_lock_order_lock: check lock order 1 for /run/samba/smbXsrv_session_global.tdb
[2022/10/21 16:06:32.668432,  5] ../../lib/dbwrap/dbwrap.c:178(dbwrap_lock_order_unlock)
  dbwrap_lock_order_unlock: release lock order 1 for /run/samba/smbXsrv_session_global.tdb
[2022/10/21 16:06:32.668475,  3] ../../source3/smbd/reply.c:2820(reply_ulogoffX_done)
  reply_ulogoffX_done: ulogoffX vuid=41336
[2022/10/21 16:06:32.669380,  5] ../../source3/lib/util_sock.c:133(read_fd_with_timeout)
  read_fd_with_timeout: blocking read. EOF from client.
[2022/10/21 16:06:32.669409,  5] ../../source3/smbd/process.c:555(receive_smb_talloc)
  receive_smb_raw_talloc failed for client ipv4:192.168.1.89:49822 read error = NT_STATUS_END_OF_FILE.
[...]
[2022/10/21 16:06:32.670391,  3] ../../source3/smbd/server_exit.c:220(exit_server_common)
  Server exit (failed to receive smb request)

I saw that in some years ago someone had the same problem

Cannot connect to Linux Samba share from Windows 10 that said that Win10 cannot Samba4 cannot support SMB3_11. But this version of the SMB has the support for this kind of connection. Here is some of the versions that are connected to the server.

PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing 
43041   admin        admin        yuri (ipv4:192.168.1.127:56284)           SMB3_11           -                    partial(AES-128-CMAC)
342734  admin        admin        server2 (ipv4:192.168.1.195:49354)        NT1               -                    -                    
342633  admin        admin        helen-pc (ipv4:192.168.1.123:50786)       SMB2_10           -                    -                    

How can I work around on this?

cn flag
`it's not the case because some computers here use this protocol to access Samba`. Not following that (absence of) logic. As another person stated, it may be helpful to remove the parts of the configuration that are wrong. Windows uses port 445 for SMB, and doesn't use SMBv1.
Score:2
ba flag

Your 'public' share is interesting because you haven't turned on guest access, you need 'map to guest = bad user' in 'global'

I would remove the 'smb ports = 139' line, you have turned off '445', I would also remove all the SMBv1 related lines unless you really need them for some old machines. You should also check if the Windows 10 machines are not blocking access via the firewall.

Anderson Silvestre avatar
tn flag
Dude, thanks for the comment. It was the port. I just comment the line and it worked.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.