smbclient accessing a Windows 7 network share

Seb James seb at esfnet.co.uk
Mon Jul 26 08:06:30 MDT 2010


Hi List,

I am experiencing the same problem described by Luca Ferrari in an email
to the Samba general list here:

http://lists.samba.org/archive/samba/2010-January/153306.html

There have been a couple of posts along these lines, but no resolution
as far as I can see.

I've experiemented with smbclient on various Linux distros, including
Samba 3.4.7 and 3.4.0 and reproduce his problem - I CAN mount the share
using mount.cifs, but cannot access it with smbclient and cannot list
the available shares with smbtree. A Windows XP SP3 system on the
network can happily list and access the shares on the Win 7 system.

I found that you can set

client ntlmv2 auth = Yes
client use spnego = Yes

Into smb.conf on the machine on which smbclient/smbtree is being run,
but this does not seem to resolve the issue (running smbtree with -d10
confirms that those parameters ARE picked up).

I've tried to configure Windows 7 to give me log messages as to why the
smbclient connection fails, with little success (due to a decade or more
avoiding windows wherever possible!)

Any theories as to what might be happening here? 

(Note: What I _really_ need to do here, is get the list of directories
shared by the Windows 7 system)

thanks for reading,

Seb James



Here's a section from "smbtree -d3 -Umyuser at mypassword" :

------------------------------------------------
        \\MARKLAPTOP                    
Connecting to host=MARKLAPTOP
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/gencache.tdb: Permission denied
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/gencache.tdb: No such file or directory
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/gencache.tdb: Permission denied
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/gencache.tdb: No such file or directory
resolve_lmhosts: Attempting lmhosts lookup for name MARKLAPTOP<0x20>
resolve_wins: Attempting wins lookup for name MARKLAPTOP<0x20>
resolve_wins: WINS server resolution selected and no WINS servers
listed.
resolve_hosts: Attempting host lookup for name MARKLAPTOP<0x20>
resolve_hosts: getaddrinfo failed for name MARKLAPTOP [Name or service
not known]
name_resolve_bcast: Attempting broadcast lookup for name
MARKLAPTOP<0x20>
Got a positive name query response from 192.168.0.29 ( 192.168.0.29
192.168.64.1 192.168.230.1 )
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/unexpected.tdb: No such file or directory
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/unexpected.tdb: No such file or directory
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/unexpected.tdb: No such file or directory
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/gencache.tdb: Permission denied
tdb(unnamed): tdb_open_ex: could not open
file /var/run/samba/gencache.tdb: No such file or directory
Connecting to 192.168.0.29 at port 445
Doing spnego session setup (blob length=336)
SPNEGO login failed: Invalid parameter
---------------------------------------------------

Here's an example smbclient session:

------------------------------------------------
wmldev at wmlvpp:~$ smbclient -d10 //192.168.0.29/archive -U myuser%mypassword
INFO: Current debug levels:
  all: True/10
  tdb: False/0
  printdrivers: False/0
  lanman: False/0
  smb: False/0
  rpc_parse: False/0
  rpc_srv: False/0
  rpc_cli: False/0
  passdb: False/0
  sam: False/0
  auth: False/0
  winbind: False/0
  vfs: False/0
  idmap: False/0
  quota: False/0
  acls: False/0
  locking: False/0
  msdfs: False/0
  dmapi: False/0
  registry: False/0
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
doing parameter workgroup = WORKGROUP
doing parameter server string = %h server (Samba, Ubuntu)
doing parameter dns proxy = no
doing parameter log file = /var/log/samba/log.%m
doing parameter max log size = 1000
doing parameter syslog = 0
doing parameter panic action = /usr/share/samba/panic-action %d
doing parameter encrypt passwords = true
doing parameter passdb backend = tdbsam
doing parameter obey pam restrictions = yes
doing parameter unix password sync = yes
doing parameter passwd program = /usr/bin/passwd %u
doing parameter passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
doing parameter pam password change = yes
doing parameter map to guest = bad user
doing parameter client ntlmv2 auth = Yes
doing parameter client use spnego = Yes
doing parameter usershare allow guests = yes
pm_process() returned Yes
lp_servicenumber: couldn't find homes
set_server_role: role = ROLE_STANDALONE
Attempting to register new charset UCS-2LE
Registered charset UCS-2LE
Attempting to register new charset UTF-16LE
Registered charset UTF-16LE
Attempting to register new charset UCS-2BE
Registered charset UCS-2BE
Attempting to register new charset UTF-16BE
Registered charset UTF-16BE
Attempting to register new charset UTF8
Registered charset UTF8
Attempting to register new charset UTF-8
Registered charset UTF-8
Attempting to register new charset ASCII
Registered charset ASCII
Attempting to register new charset 646
Registered charset 646
Attempting to register new charset ISO-8859-1
Registered charset ISO-8859-1
Attempting to register new charset UCS2-HEX
Registered charset UCS2-HEX
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
added interface virbr0 ip=fe80::70:f8ff:fe4d:805e%virbr0 bcast=fe80::ffff:ffff:ffff:ffff%virbr0 netmask=ffff:ffff:ffff:ffff::
added interface br0 ip=fe80::21d:9ff:fe25:dac2%br0 bcast=fe80::ffff:ffff:ffff:ffff%br0 netmask=ffff:ffff:ffff:ffff::
added interface vnet1 ip=fe80::1030:eaff:fe8f:419c%vnet1 bcast=fe80::ffff:ffff:ffff:ffff%vnet1 netmask=ffff:ffff:ffff:ffff::
added interface vnet2 ip=fe80::14a6:26ff:fec6:bfb9%vnet2 bcast=fe80::ffff:ffff:ffff:ffff%vnet2 netmask=ffff:ffff:ffff:ffff::
added interface vnet6 ip=fe80::1882:f6ff:fed3:944e%vnet6 bcast=fe80::ffff:ffff:ffff:ffff%vnet6 netmask=ffff:ffff:ffff:ffff::
added interface vnet10 ip=fe80::285f:d2ff:fe4c:677e%vnet10 bcast=fe80::ffff:ffff:ffff:ffff%vnet10 netmask=ffff:ffff:ffff:ffff::
added interface vnet9 ip=fe80::286c:fff:feff:2fd0%vnet9 bcast=fe80::ffff:ffff:ffff:ffff%vnet9 netmask=ffff:ffff:ffff:ffff::
added interface vnet3 ip=fe80::2c91:eff:fea6:f5f6%vnet3 bcast=fe80::ffff:ffff:ffff:ffff%vnet3 netmask=ffff:ffff:ffff:ffff::
added interface vnet4 ip=fe80::5451:6bff:fe3a:7935%vnet4 bcast=fe80::ffff:ffff:ffff:ffff%vnet4 netmask=ffff:ffff:ffff:ffff::
added interface vnet5 ip=fe80::602a:3dff:fe36:3974%vnet5 bcast=fe80::ffff:ffff:ffff:ffff%vnet5 netmask=ffff:ffff:ffff:ffff::
added interface vnet8 ip=fe80::684b:4aff:feb6:7b18%vnet8 bcast=fe80::ffff:ffff:ffff:ffff%vnet8 netmask=ffff:ffff:ffff:ffff::
added interface vnet0 ip=fe80::c829:64ff:fe6f:a432%vnet0 bcast=fe80::ffff:ffff:ffff:ffff%vnet0 netmask=ffff:ffff:ffff:ffff::
added interface vnet7 ip=fe80::ccd1:7cff:fe2d:b3d9%vnet7 bcast=fe80::ffff:ffff:ffff:ffff%vnet7 netmask=ffff:ffff:ffff:ffff::
added interface vnet11 ip=fe80::f0e0:24ff:feaf:4864%vnet11 bcast=fe80::ffff:ffff:ffff:ffff%vnet11 netmask=ffff:ffff:ffff:ffff::
added interface br0 ip=192.168.0.2 bcast=192.168.0.255 netmask=255.255.255.0
added interface virbr0 ip=192.168.122.1 bcast=192.168.122.255 netmask=255.255.255.0
Netbios name list:-
my_netbios_names[0]="WMLVPP"
Client started (version 3.4.7).
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a893a30
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a894070
Running timed event "tevent_req_timedout" 0x7fd16a893a30
s3_event: Destroying timer event 0x7fd16a893a30 "tevent_req_timedout"
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a893910
Connecting to 192.168.0.29 at port 445
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a894910
Running timed event "tevent_req_timedout" 0x7fd16a894070
s3_event: Destroying timer event 0x7fd16a894070 "tevent_req_timedout"
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a893f50
Connecting to 192.168.0.29 at port 139
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a8951b0
s3_event: Destroying timer event 0x7fd16a8951b0 "tevent_req_timedout"
s3_event: Destroying timer event 0x7fd16a893f50 "tevent_req_timedout"
Socket options:
        SO_KEEPALIVE = 0
        SO_REUSEADDR = 0
        SO_BROADCAST = 0
        TCP_NODELAY = 1
        TCP_KEEPCNT = 9
        TCP_KEEPIDLE = 7200
        TCP_KEEPINTVL = 75
        IPTOS_LOWDELAY = 0
        IPTOS_THROUGHPUT = 0
        SO_SNDBUF = 16384
        SO_RCVBUF = 87380
        SO_SNDLOWAT = 1
        SO_RCVLOWAT = 1
        SO_SNDTIMEO = 0
        SO_RCVTIMEO = 0
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
write_socket(7,72)
write_socket(7,72) wrote 72
Sent session request
got smb length of 1
size=1
smb_com=0x0
smb_rcls=0
smb_reh=0
smb_err=0
smb_flg=0
smb_flg2=0
smb_tid=0
smb_pid=0
smb_uid=0
smb_mid=0
smt_wct=0
smb_bcc=0
lang_tdb_init: /usr/share/samba/en_GB.UTF-8.msg: No such file or directory
session request to 192.168.0.29 failed (Called name not present)
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a8940f0
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a895d40
Running timed event "tevent_req_timedout" 0x7fd16a8940f0
s3_event: Destroying timer event 0x7fd16a8940f0 "tevent_req_timedout"
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a894bf0
Connecting to 192.168.0.29 at port 445
s3_event: Added timed event "tevent_req_timedout": 0x7fd16a8965e0
s3_event: Destroying timer event 0x7fd16a8965e0 "tevent_req_timedout"
s3_event: Destroying timer event 0x7fd16a894bf0 "tevent_req_timedout"
Socket options:
        SO_KEEPALIVE = 0
        SO_REUSEADDR = 0
        SO_BROADCAST = 0
        TCP_NODELAY = 1
        TCP_KEEPCNT = 9
        TCP_KEEPIDLE = 7200
        TCP_KEEPINTVL = 75
        IPTOS_LOWDELAY = 0
        IPTOS_THROUGHPUT = 0
        SO_SNDBUF = 16384
        SO_RCVBUF = 87380
        SO_SNDLOWAT = 1
        SO_RCVLOWAT = 1
        SO_SNDTIMEO = 0
        SO_RCVTIMEO = 0
 session request ok
cli_chain_cork: mid=1
handle_incoming_pdu: got mid 1
Doing spnego session setup (blob length=336)
SPNEGO login failed: Invalid parameter
session setup failed: SUCCESS - 0
wmldev at wmlvpp:~$ 
------------------------------------------------







More information about the samba-technical mailing list