# [Solved]I cannot browse or connect to the Linux Samba shares

## abryantsev

Hi!

I got weird Samba behaviour, it seems to me it happened when I compiled Samba with kerberos ldap and winbind support. I didn't notice exact time, but everything worked fine before. My security was DOMAIN, and I decided to use ADS. I compiled Samba 3.0.10 with kerberos, ldap and winbind support and did all needed steps to join into ADS. Now I have fully worked environment with kerberos and winbind authentication. I can browse, connect and mount to any other W2k, XP and samba (without kerberos/ldap/winbind support) shares.  But I cannot connect or browse shares on my current Linux Samba server. I getting the following error:

```

Gentoo samba # smbclient -L gentoo -U andrew

Password:

tree connect failed: ERRDOS - ERRnoaccess (Access denied.)

Gentoo samba # smbstatus -S

Service      pid     machine       Connected at

-------------------------------------------------------

Gentoo samba # testparm -s

Load smb config files from /etc/samba/smb.conf

Processing section "[homes]"

Processing section "[printers]"

Processing section "[print$]"

Loaded services file OK.

# Global parameters

[global]

        dos charset = CP866

        workgroup = OTKENT

        realm = OTKE.NT

        server string = Gentoo

        security = ADS

        passdb backend = smbpasswd, tdbsam

        pam password change = Yes

        username map = /etc/samba/smbusers

        log level = 5

        syslog = 0

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

        max protocol = COREPLUS

        server signing = auto

        socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384

        local master = No

        dns proxy = No

        wins server = 192.168.3.102, 192.168.9.103

        ldap ssl = no

        idmap uid = 10000-20000

        idmap gid = 10000-20000

        vscan-clamav:config-file = /etc/samba/vscan-clamav.conf

        hosts allow = 192.168.2., 192.168.11., 192.168.8., 192.168.9., 192.168.8., 192.168.4., 192.168.9., 192.168.3., 192.168.15., 192.168.5., 192.168.14., 192.168.10., 127.0.0.1, 0.0.0.0

        vfs objects = vscan-clamav

[homes]

        comment = Home Directory for '%u'

        read only = No

[printers]

        comment = All Printers

        path = /var/spool/samba

        printer admin = root

        guest ok = Yes

        printable = Yes

        browseable = No

[print$]

        comment = Printer Drivers

        path = /usr/share/cups/drivers

        write list = root

```

Here it is a part from my samba log with debug level 10.

```

Gentoo samba # tail -f /var/log/samba/log.192.168.4.10

andrew@Gentoo ~ $ smbclient -L gentoo -U andrew

Password:

tree connect failed: ERRDOS - ERRnoaccess (Access denied.)

```

Debug dump follows:

```

[2005/07/20 20:20:51, 6] param/loadparm.c:lp_file_list_changed(2686)

  lp_file_list_changed()

  file /etc/samba/smb.conf -> /etc/samba/smb.conf  last mod_time: Wed Jul 20 20:20:19 2005

[2005/07/20 20:20:51, 3] smbd/oplock.c:init_oplocks(1302)

  open_oplock_ipc: opening loopback UDP socket.

[2005/07/20 20:20:51, 10] lib/util_sock.c:open_socket_in(717)

  bind succeeded on port 0

[2005/07/20 20:20:51, 3] smbd/oplock_linux.c:linux_init_kernel_oplocks(303)

  Linux kernel oplocks enabled

[2005/07/20 20:20:51, 3] smbd/oplock.c:init_oplocks(1333)

  open_oplock ipc: pid = 2052, global_oplock_port = 39328

[2005/07/20 20:20:51, 4] lib/time.c:get_serverzone(122)

  Serverzone is -10800

[2005/07/20 20:20:51, 10] lib/util_sock.c:read_smb_length_return_keepalive(505)

  got smb length of 179

[2005/07/20 20:20:51, 3] lib/access.c:check_access(313)

  check_access: no hostnames in host allow/deny list.

[2005/07/20 20:20:51, 2] lib/access.c:check_access(324)

  Allowed connection from  (192.168.4.10)

[2005/07/20 20:20:51, 6] smbd/process.c:process_smb(1090)

  got message type 0x0 of len 0xb3

[2005/07/20 20:20:51, 3] smbd/process.c:process_smb(1091)

  Transaction 0 of length 183

[2005/07/20 20:20:51, 5] lib/util.c:show_msg(464)

[2005/07/20 20:20:51, 5] lib/util.c:show_msg(474)

  size=179

  smb_com=0x72

  smb_rcls=0

  smb_reh=0

  smb_err=0

  smb_flg=8

  smb_flg2=51201

  smb_tid=0

  smb_pid=2051

  smb_uid=0

  smb_mid=1

  smt_wct=0

  smb_bcc=144

[2005/07/20 20:20:51, 10] lib/util.c:dump_data(1977)

  [000] 02 50 43 20 4E 45 54 57  4F 52 4B 20 50 52 4F 47  .PC NETW ORK PROG

  [010] 52 41 4D 20 31 2E 30 00  02 4D 49 43 52 4F 53 4F  RAM 1.0. .MICROSO

  [020] 46 54 20 4E 45 54 57 4F  52 4B 53 20 31 2E 30 33  FT NETWO RKS 1.03

  [030] 00 02 4D 49 43 52 4F 53  4F 46 54 20 4E 45 54 57  ..MICROS OFT NETW

  [040] 4F 52 4B 53 20 33 2E 30  00 02 4C 41 4E 4D 41 4E  ORKS 3.0 ..LANMAN

  [050] 31 2E 30 00 02 4C 4D 31  2E 32 58 30 30 32 00 02  1.0..LM1 .2X002..

  [060] 44 4F 53 20 4C 41 4E 4D  41 4E 32 2E 31 00 02 53  DOS LANM AN2.1..S

  [070] 61 6D 62 61 00 02 4E 54  20 4C 41 4E 4D 41 4E 20  amba..NT  LANMAN

  [080] 31 2E 30 00 02 4E 54 20  4C 4D 20 30 2E 31 32 00  1.0..NT  LM 0.12.

[2005/07/20 20:20:51, 3] smbd/process.c:switch_message(886)

  switch message SMBnegprot (pid 2052) conn 0x0

[2005/07/20 20:20:51, 3] smbd/sec_ctx.c:set_sec_ctx(288)

  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0

[2005/07/20 20:20:51, 5] auth/auth_util.c:debug_nt_user_token(486)

  NT user token: (NULL)

[2005/07/20 20:20:51, 5] auth/auth_util.c:debug_unix_user_token(505)

  UNIX token of user 0

  Primary group is 0 and contains 0 supplementary groups

[2005/07/20 20:20:51, 5] smbd/uid.c:change_to_root_user(296)

  change_to_root_user: now uid=(0,0) gid=(0,0)

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(461)

  Requested protocol [PC NETWORK PROGRAM 1.0]

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(461)

  Requested protocol [MICROSOFT NETWORKS 1.03]

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(461)

  Requested protocol [MICROSOFT NETWORKS 3.0]

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(461)

  Requested protocol [LANMAN1.0]

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(461)

  Requested protocol [LM1.2X002]

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(461)

  Requested protocol [DOS LANMAN2.1]

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(461)

  Requested protocol [Samba]

[2005/07/20 20:20:51, 10] lib/util.c:set_remote_arch(1952)

  set_remote_arch: Client arch is 'Samba'

[2005/07/20 20:20:51, 6] param/loadparm.c:lp_file_list_changed(2686)

  lp_file_list_changed()

  file /etc/samba/smb.conf -> /etc/samba/smb.conf  last mod_time: Wed Jul 20 20:20:19 2005

[2005/07/20 20:20:51, 6] param/loadparm.c:lp_file_list_changed(2686)

  lp_file_list_changed()

  file /etc/samba/smb.conf -> /etc/samba/smb.conf  last mod_time: Wed Jul 20 20:20:19 2005

[2005/07/20 20:20:51, 3] smbd/negprot.c:reply_negprot(549)

  Selected protocol MICROSOFT NETWORKS 1.03

[2005/07/20 20:20:51, 5] smbd/negprot.c:reply_negprot(555)

  negprot index=1

[2005/07/20 20:20:51, 5] lib/util.c:show_msg(464)

[2005/07/20 20:20:51, 5] lib/util.c:show_msg(474)

  size=61

  smb_com=0x72

  smb_rcls=0

  smb_reh=0

  smb_err=0

  smb_flg=129

  smb_flg2=49153

  smb_tid=0

  smb_pid=2051

  smb_uid=0

  smb_mid=1

  smt_wct=13

  smb_vwv[ 0]=    1 (0x1)

  smb_vwv[ 1]=    1 (0x1)

  smb_vwv[ 2]=    0 (0x0)

  smb_vwv[ 3]=    0 (0x0)

  smb_vwv[ 4]=    0 (0x0)

  smb_vwv[ 5]=    3 (0x3)

  smb_vwv[ 6]=    0 (0x0)

  smb_vwv[ 7]=    0 (0x0)

  smb_vwv[ 8]=    0 (0x0)

  smb_vwv[ 9]=    0 (0x0)

  smb_vwv[10]=    0 (0x0)

  smb_vwv[11]=    0 (0x0)

  smb_vwv[12]=    0 (0x0)

  smb_bcc=0

[2005/07/20 20:20:51, 6] lib/util_sock.c:write_socket(449)

  write_socket(24,65)

[2005/07/20 20:20:51, 6] lib/util_sock.c:write_socket(452)

  write_socket(24,65) wrote 65

[2005/07/20 20:21:47, 6] param/loadparm.c:lp_file_list_changed(2686)

  lp_file_list_changed()

  file /etc/samba/smb.conf -> /etc/samba/smb.conf  last mod_time: Wed Jul 20 20:20:19 2005

[2005/07/20 20:21:47, 3] smbd/oplock.c:init_oplocks(1302)

  open_oplock_ipc: opening loopback UDP socket.

[2005/07/20 20:21:47, 10] lib/util_sock.c:open_socket_in(717)

  bind succeeded on port 0

[2005/07/20 20:21:47, 3] smbd/oplock_linux.c:linux_init_kernel_oplocks(303)

  Linux kernel oplocks enabled

[2005/07/20 20:21:47, 3] smbd/oplock.c:init_oplocks(1333)

  open_oplock ipc: pid = 2062, global_oplock_port = 39338

[2005/07/20 20:21:47, 4] lib/time.c:get_serverzone(122)

  Serverzone is -10800

[2005/07/20 20:21:47, 10] lib/util_sock.c:read_socket_data(378)

  read_socket_data: recv of 4 returned 0. Error = Success

[2005/07/20 20:21:47, 10] lib/util_sock.c:receive_smb_raw(556)

  receive_smb_raw: length < 0!

[2005/07/20 20:21:47, 3] smbd/process.c:timeout_processing(1336)

  timeout_processing: End of file from client (client has disconnected).

[2005/07/20 20:21:47, 5] lib/gencache.c:gencache_shutdown(88)

  Closing cache file

[2005/07/20 20:21:47, 5] libsmb/namecache.c:namecache_shutdown(79)

  namecache_shutdown: netbios namecache closed successfully.

[2005/07/20 20:21:47, 3] smbd/sec_ctx.c:set_sec_ctx(288)

  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0

[2005/07/20 20:21:47, 5] auth/auth_util.c:debug_nt_user_token(486)

  NT user token: (NULL)

[2005/07/20 20:21:47, 5] auth/auth_util.c:debug_unix_user_token(505)

  UNIX token of user 0

  Primary group is 0 and contains 0 supplementary groups

[2005/07/20 20:21:47, 5] smbd/uid.c:change_to_root_user(296)

  change_to_root_user: now uid=(0,0) gid=(0,0)

[2005/07/20 20:21:47, 2] smbd/server.c:exit_server(571)

  Closing connections

[2005/07/20 20:21:47, 3] smbd/connection.c:yield_connection(69)

  Yielding connection to

[2005/07/20 20:21:47, 3] smbd/connection.c:yield_connection(76)

  yield_connection: tdb_delete for name  failed with error Record does not exist.

[2005/07/20 20:21:47, 5] smbd/oplock.c:receive_local_message(107)

  receive_local_message: doing select with timeout of 1 ms

[2005/07/20 20:21:47, 3] smbd/server.c:exit_server(614)

  Server exit (normal exit)

[2005/07/20 20:21:51, 10] lib/util_sock.c:read_smb_length_return_keepalive(505)

  got smb length of 92

[2005/07/20 20:21:51, 6] smbd/process.c:process_smb(1090)

  got message type 0x0 of len 0x5c

[2005/07/20 20:21:51, 3] smbd/process.c:process_smb(1091)

  Transaction 1 of length 96

[2005/07/20 20:21:51, 5] lib/util.c:show_msg(464)

[2005/07/20 20:21:51, 5] lib/util.c:show_msg(474)

  size=92

  smb_com=0x75

  smb_rcls=0

  smb_reh=0

  smb_err=0

  smb_flg=8

  smb_flg2=49153

  smb_tid=0

  smb_pid=2051

  smb_uid=0

  smb_mid=2

  smt_wct=4

  smb_vwv[ 0]=  255 (0xFF)

  smb_vwv[ 1]=    0 (0x0)

  smb_vwv[ 2]=    0 (0x0)

  smb_vwv[ 3]=   14 (0xE)

  smb_bcc=49

[2005/07/20 20:21:51, 10] lib/util.c:dump_data(1977)

  [000] 66 6C 76 62 79 62 63 6E  68 66 6E 6A 68 00 00 5C  flvbybcn hfnjh..\

  [010] 00 5C 00 47 00 45 00 4E  00 54 00 4F 00 4F 00 5C  .\.G.E.N .T.O.O.\

  [020] 00 49 00 50 00 43 00 24  00 00 00 3F 3F 3F 3F 3F  .I.P.C.$ ...?????

  [030] 00                                                .

----------

## abryantsev

I reemerged Samba without kerberos/ldap/winbind support but nothing happened - I can't browse my local Samba shares. According to debug logs, the session setup phase isn't succesfull 

```

[2005/07/21 09:26:02, 4] smbd/reply.c:reply_tcon_and_X(408)

  Client requested device type [?????] for share [IPC$]

[2005/07/21 09:26:02, 1] smbd/service.c:make_connection(735)

  make_connection: refusing to connect with no session setup

[2005/07/21 09:26:02, 3] smbd/error.c:error_packet(145)

  error packet at smbd/reply.c(416) cmd=117 (SMBtconX) eclass=1 ecode=5

[2005/07/21 09:26:02, 5] lib/util.c:show_msg(464)

[2005/07/21 09:26:02, 5] lib/util.c:show_msg(474)

  size=35

  smb_com=0x75

  smb_rcls=1

  smb_reh=0

  smb_err=5

  smb_flg=136

  smb_flg2=32769

  smb_tid=0

  smb_pid=19352

  smb_uid=0

  smb_mid=2

  smt_wct=0

  smb_bcc=0

```

I have Gentoo kernel 2.6.10-r7, and I emerged unstable world[/code] with unmasked x86 option.

```

Gentoo ~#emerge --info

Gentoo Base System version 1.6.12

Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 2.6.10-gentoo-r7 i686)

=================================================================

System uname: 2.6.10-gentoo-r7 i686 Pentium II (Deschutes)

ccache version 2.4 [enabled]

dev-lang/python:     2.3.5, 2.4.1-r1

sys-apps/sandbox:    1.2.10

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5

sys-devel/binutils:  2.16.1

sys-devel/libtool:   1.5.18-r1

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O3 -march=pentium2 -funroll-loops -pipe -fPIC"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control /var/service"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"

CXXFLAGS="-O3 -march=pentium2 -funroll-loops -pipe -fPIC"

DISTDIR="/var/portage/distfiles"

FEATURES="autoconfig ccache distlocks sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"

LANG="ru_RU.KOI8-R"

LINGUAS="ru"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 X acl acpi apm arts avi berkdb bitmap-fonts cdr crypt cups curl directfb eds emboss encode esd fam font-server foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk gtk2 guile imlib java jpeg kdeenablefinal kerberos ldap libclamav libg++ libwww mad mikmod mmx motif mozilla mp3 mpeg ncurses nls oav ogg oggvorbis opengl oss pam pdflib perl pic png python qt quicktime quotas readline samba sdl slang spell ssl svga tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts vorbis winbind xml xml2 xmms xprint xv zlib linguas_ru userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, PORTDIR_OVERLAY

```

----------

## abryantsev

Somehow I corrupt the smb.cfg file and put an option in it

```

max protocol = COREPLUS

```

No I restore to default value NT1 and everything works perfectly.

Thank you for your attention. Topic is closed.

----------

