Cannot connect to Linux Samba share from Windows 10

188,228

Solution 1

This solved my problem:

Windows 10 will try to negotiate SMB3_11, which Samba4 doesn't yet support
except in the current 4.3 release candidate. I suspect for now disabling
SMB2/3 on the Windows 10 client is your best, if not ideal, option.

Instructions for doing.this can be found
here: https://support.microsoft.com/en-us/kb/2696547

https://lists.samba.org/archive/samba/2015-September/193886.html

Further reading:

Solution 2

I think I have a solution that works on Windows 7 - 10 and on Server 2012

In my case commenting out my line "smb ports 139" helped.

I am using FreeBSD 10 with Samba 4.4.5

Here is a copy of my SMB4.conf. I hope it helps someone.

[global]
    netbios name = SERV
    server string = FreeBSD Samba Server
    security = ADS
    workgroup = FFTPJ
    realm = fftpj.local

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

    # Default idmap config used for BUILTIN and local windows accounts/groups
    idmap config *:backend = tdb
    idmap config *:range = 2000-9999

    # idmap config for domain FFTPJ
    idmap config DOMAIN:backend = rid
    idmap config DOMAIN:range = 10000-99999

    # Use template settings for login shell and home directory
    winbind nss info = template
    winbind enum users = Yes
    winbind enum groups = Yes
    winbind use default domain = yes

    client use spnego = yes
    client ntlmv2 auth = yes

    encrypt passwords = yes
    restrict anonymous = 2

    valid users = @"Domain Users

    # **** When smb ports is Set Windows 10 clients cannot connect
    #smb ports = 139

    load printers = No
    disable spoolss = Yes
    local master = No
    hide dot files = No
    wide links = No
    store dos attributes = yes

    vfs objects = acl_xattr
    map acl inherit = yes

[images]
    comment = Images Drive
    path = /images
    read only = No

[backups]
    comment = Backup Drive
    path = /data/backup
    read only = No

Solution 3

Problem: Windows removed SMB v1 protocol on latest Windows OS, Linux try to connect with v1 protocol and Windows/Linux fails to try protocol 2, 3 etc.

Solution: edit linux (ubuntu) Samba conf file:

sudo nano /etc/samba/smb.conf

on the [GLOBAL] section add:

client min protocol = SMB2

client max protocol = SMB3

then save file and restart samba

in my case I also had to explicit put a password or my Samba user, but I think that was my specific system problem.

Solution 4

I agree with others related to default setting in Windows 10 as a client. Anyway I got it working WITHOUT any changes on client side with this setting in Global section on samba server (samba-4.7.1-9.el7_5.x86_64 - repo version for CentOs 7):

[global]
    workgroup = <workgroup>
    realm = <realm>
    server string = FileShare server
    netbios name = <nbname>
    interfaces = lo eth0 <...>
    hosts allow = 127. 192.168.0. <...>
    log file = /var/log/samba/log.%m
    max log size = 10240
    security = user
    map to guest = Bad Password
    usershare allow guests = No
    server signing = auto
    passdb backend = tdbsam
    local master = yes

    vfs objects = acl_xattr
    map acl inherit = yes
    store dos attributes = yes

    winbind nss info = template
    winbind enum users = Yes
    winbind enum groups = Yes
    winbind use default domain = yes

    client use spnego = yes
    client ntlmv2 auth = yes

    encrypt passwords = yes

    local master = No
    hide dot files = No
    allow insecure wide links = yes
    store dos attributes = yes

Solution 5

I'm a beginner in Linux. I tried a lot of options. After many hours spent, I found the solution!

(I recommend to make a copy of smb.conf, and after try to make changes) Works 100% on windows 10/7/8/Ubuntu at 07.06.2017 with fresh install of Ubuntu and samba

Another thing I think is important, change path to /home/server-media/Desktop/test or create same path at your server!

To start and stop samba use command

/etc/init.d/smbd stop
/etc/init.d/smbd start

For easy edit use midnight commander. Start in command from root "mc"

Copy all text from the config below. After you try and are sure it is working, you can delete the old one.

[global]

#editat la ora 20:30 in data 07.06.2017

server max protocol = SMB3
encrypt passwords = yes
dns proxy = no
strict locking = no
oplocks = yes                                                                                                                   
deadtime = 15
max log size = 51200
max open files = 933761
logging = file
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
getwd cache = yes
guest account = nobody
map to guest = Bad User
obey pam restrictions = yes
directory name cache size = 0
kernel change notify = no
panic action = /usr/local/libexec/samba/samba-backtrace
nsupdate command = /usr/local/bin/samba-nsupdate -g
server string = Media Server
# habarnam de ce dar urmatoarele lini au importanta in wingoz
ea support = yes
store dos attributes = yes
lm announce = yes
hostname lookups = yes
# time server nu conteaza dar mi-l trebuie
time server = yes
acl allow execute always = true
dos filemode = yes
multicast dns register = yes
domain logons = no
local master = yes
idmap config *: backend = tdb
idmap config *: range = 90000001-100000000
server role = standalone
netbios name = MEDIA SERVER
workgroup = WORKGROUP
# am incercat si cu = share si apar erori la pornirea samba
security = user
pid directory = /home/server-media/Desktop/test
# aici am incercat cu mai multe variante ca si 0775 sau 0700 sau 0600 etc.
create mask = 0666
directory mask = 0777
client ntlmv2 auth = yes
# asta iara nu mai e important!
dos charset = CP437
unix charset = UTF-8       
log level = 1          





[homes]
comment = Home Directories
path = /home
valid users = %U
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = no
printable = no
locking = no
strict locking = no

[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
#din no in yes la read
read only = yes
available = yes
browseable = yes
writable = no
#din no in yes la guest
guest ok = yes
public = no
printable = no
locking = no
strict locking = no

[profiles]
comment = User Profiles
path = /var/lib/samba/profiles
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = no
printable = no
#din 0600
create mode = 0666
#din 0700
directory mask = 0777
locking = no
strict locking = no

[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
writable = no
#guest am pus yes
guest ok = yes
public = no
printable = yes
locking = no
strict locking = no
#am bagat urm linii
read only = no
create mask = 0775

[pdf-documents]
path = /var/lib/samba/pdf-documents
comment = Converted PDF Documents
admin users = %U
available = yes
browseable = yes
writeable = yes
guest ok = yes
locking = no
strict locking = no

[pdf-printer]
path = /tmp
comment = PDF Printer Service
printable = yes
guest ok = yes
use client driver = yes
printing = bsd
print command = /usr/bin/gadmin-samba-pdf %s %u
lpq command =
lprm command =

[test]
path = /home/server-media/Desktop/test
comment = doar de test
valid users = test
write list = test
admin users = test
directory mask = 0755
create mode = 0777
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = yes
printable = no
locking = no
strict locking = no
Share:
188,228

Related videos on Youtube

pngl
Author by

pngl

Updated on September 18, 2022

Comments

  • pngl
    pngl over 1 year

    I have a Samba server version 4.1.11 running on Ubuntu 14.04. I cannot connect from Windows 10 (but I can from Windows 7).

    The server and the clients are not on the same LAN.

    The error message given by Windows is that the server is online but not responding. However the Samba logs say otherwise.

    I have attached the logs for a failed connection attempt from Windows 10, and those for a successful attempt from Windows 7 (for comparison).

    Briefly, unlike the successful attempt, the failed one starts with:

    switch message SMBnegprot (pid 2855) conn 0x0
    

    then it requests a number of different protocols before selecting SMB2_FF. Then, after some security negotiations, it switches to protocol SMB 2.???, then SMB3_00, followed by:

    Server exit (NT_STATUS_END_OF_FILE).
    

    The successful attempt selects protocol SMB2_10 from the start, but this protocol is not even requested by Windows 10.

    Here are the logs :

    Failed attempt (from Windows 10)
    http://pastebin.com/M0xmBuY3

    Successful attempt (from Windows 7)
    http://pastebin.com/jF8VzaiA

    I've added my smb.conf file in a comment (can't have more than 2 links with <10 reputation)

  • Beto Neto
    Beto Neto about 8 years
    Guys, don't do this. This will brick your network, you will not be able to access even a single share.
  • Kamil J
    Kamil J over 5 years
    This works but require change on setting on each single client which would access the share... It can be realize without change on client side just adding few "extra" options on samba side.
  • Kamil J
    Kamil J over 5 years
    There is more then just needed options in your config. But finally better few not needed options but working than not working config... Thanks for sharing.
  • Zoltan
    Zoltan over 5 years
    After spending a whole day on the problem, commenting out the line "smb ports 139" REALLY helped! Thanks a ton!!
  • Gryu
    Gryu about 4 years
    Please, tell how did you do it and why it have been enabled. It's not fully clear to me.
  • sekrett
    sekrett about 4 years
    Jumbo packet is not actually an option. It means you set MTU on your network card to 9000, while the standard value is 1500. I enabled it because on a Gigabit or 10Gb connection you get a higher speed, no need to change it on 100mb connection. But if it breaks something, better set it to standard.
  • dortegaoh
    dortegaoh about 4 years
    The line you edited is commented out. It doesn't change anything in the active configuration.
  • SurpriseDog
    SurpriseDog almost 4 years
    Thank you, this worked!
  • Marki555
    Marki555 about 3 years
    duplicate of existing older answer