SliTaz SliTaz Forum

You are not logged in.

#1 2015-08-28 20:22:03

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Who can help me with smbclient (... or Windows ?)

Hi all,

First, sorry for this too long post but I've made a lot of tests and posted all the results. Well, my problem:

I'd like to access to the shared directories on my PC Windows (XP SP3) from my PC Linux (SliTaz rolling) but I get invariably the same answer: Connection to MSNET failed (Error NT_STATUS_UNSUCCESSFUL). Here is my config:

The 2 computers are connected on a box.

[*]PC Linux

hostname = SAMBA
           

[*]smbclient is installed
           

[*]/etc/samba/smb.conf=
[global]

                    workgroup = WORKGROUP

                    security = user

                    map to guest = Bad User

                    [homes]

                    comment = Home Directories

                    valid users = %S

                    guest ok = no

                    read only = no
               

[*]PC Windows

hostname = MSNET
           

[*]workgroup = WORKGROUP
           

[c]

$ smbclient -L MSNET -U shared[/c]

smbclient prompts me for shared's password and then after 20 seconds...

[c]Connection to MSNET failed (Error NT_STATUS_UNSUCCESSFUL)[/c]

A search on internet learnt me it is a generic message that means "something goes wrong"...

I've tested a lot of configurations, I even crossed cables on the box.

MSNET doesn't answer when I ping it from SAMBA but SAMBA answers when I ping it from MSNET:

>ping -a SAMBA

Envoi d'une requête 'ping' sur SAMBA.home [192.168.1.14] avec 32 octets de données :
Réponse de 192.168.1.14 : octets=32 temps<1ms TTL=64
Réponse de 192.168.1.14 : octets=32 temps<1ms TTL=64
Réponse de 192.168.1.14 : octets=32 temps<1ms TTL=64
Réponse de 192.168.1.14 : octets=32 temps<1ms TTL=64

Statistiques Ping pour 192.168.1.14:
    Paquets : envoyés = 4, reçus = 4, perdus = 0 (perte 0%),
Durée approximative des boucles en millisecondes :
    Minimum = 0ms, Maximum = 0ms, Moyenne = 0ms

>ping -a MSNET

Envoi d'une requête 'ping' sur MSNET [192.168.1.15] avec 32 octets de données :
Réponse de 192.168.1.15 : octets=32 temps<1ms TTL=128
Réponse de 192.168.1.15 : octets=32 temps<1ms TTL=128
Réponse de 192.168.1.15 : octets=32 temps<1ms TTL=128
Réponse de 192.168.1.15 : octets=32 temps<1ms TTL=128

Statistiques Ping pour 192.168.1.15:
    Paquets : envoyés = 4, reçus = 4, perdus = 0 (perte 0%),
Durée approximative des boucles en millisecondes :
    Minimum = 0ms, Maximum = 0ms, Moyenne = 0ms

Then I booted SliTaz on MSNET and run Samba, no problem. OK too when I run smbclient on MSNET and samba on SAMBA.

I finally ran smbclient with debug level 3:

[c]$ smbclient -L MSNET -d 3 -U shared

lp_load_ex: refreshing parameters

Initialising global parameters

rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)

params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"

Processing section "[global]"

added interface eth0 ip=fe80::200:e2ff:fe8d:52aa%eth0 bcast=fe80::ffff:ffff:ffff:ffff%eth0 netmask=ffff:ffff:ffff:ffff::

added interface eth0 ip=192.168.1.14 bcast=192.168.1.255 netmask=255.255.255.0

Client started (version 3.6.7).

Enter shared's password:

tdb(/var/run/samba/gencache.tdb): tdb_open_ex: could not open file /var/run/samba/gencache.tdb: Permission denied

resolve_lmhosts: Attempting lmhosts lookup for name MSNET<0x20>

resolve_lmhosts: Attempting lmhosts lookup for name MSNET<0x20>

resolve_wins: Attempting wins lookup for name MSNET<0x20>

resolve_wins: WINS server resolution selected and no WINS servers listed.

resolve_hosts: Attempting host lookup for name MSNET<0x20>

Connecting to 192.168.1.15 at port 445

Connecting to 192.168.1.15 at port 139

Error connecting to 192.168.1.15 (Success)

Connection to MSNET failed (Error NT_STATUS_UNSUCCESSFUL)[/c]

192.168.1.14 is the correct IP address for SAMBA and

192.168.1.15 is the correct IP address for MSNET

I scanned ports 139 and 445

[*]from SAMBA:

$ pscan -cb -p 139 -P 139 MSNET
Scanning MSNET ports 139 to 139
Port    Proto    State    Service
  139    tcp    blocked    netbios-ssn
0 closed, 0 open, 1 timed out (or blocked) ports

$ pscan -cb -p 445 -P 445 MSNET
Scanning MSNET ports 445 to 445
Port    Proto    State    Service
  445    tcp    blocked    unknown
0 closed, 0 open, 1 timed out (or blocked) ports

[*]from MSNET:

>portqry -n msnet -o 139,445

Querying target system called:
msnet
Attempting to resolve name to IP address...

Name resolved to 192.168.1.15
querying...
TCP port 139 (netbios-ssn service): LISTENING
TCP port 445 (microsoft-ds service): LISTENING

>portqry -wport 139

PortQry Version 2.0
Watching port: 139

Checking for changes every 60 seconds
**press escape to stop watching port

============
System Date: Fri Aug 28 21:10:50 2015

PID    Port        Local IP    State         Remote IP:Port
4    TCP 445      0.0.0.0     LISTENING     0.0.0.0:38926
4    TCP 139      192.168.1.15     LISTENING     0.0.0.0:2256
4    UDP 445      0.0.0.0              *:*
4    UDP 137      192.168.1.15              *:*
4    UDP 138      192.168.1.15              *:*

Port Statistics
TCP mappings: 2
UDP mappings: 3

TCP ports in a LISTENING state:     2 = 100.00%

>portqry -n msnet

Querying target system called:
msnet
Attempting to resolve name to IP address...

Name resolved to 192.168.1.15
querying...
TCP port 80 (http service): NOT LISTENING

>portqry -n samba

Querying target system called:
samba
Attempting to resolve name to IP address...

Name resolved to 192.168.1.14
querying...
TCP port 80 (http service): LISTENING

Does the problem come from port 80 on my PC Windows?

Can the firewall on the PC Windows block the communication?

...

The other problem is... , I'm totally ignorant in networking.

Offline

#2 2015-08-28 21:05:51

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Who can help me with smbclient (... or Windows ?)

Hi Ceel,

Want to say I not connected to the Windows machines from Linux.

There's package gvfs-smb exists. Seems it designed to open URLs started with "smb:///" using file manager like PCManFM.

Side note. I see reading error in your log:

[c]Enter shared's password:
tdb(/var/run/samba/gencache.tdb): tdb_open_ex: could not open file /var/run/samba/gencache.tdb: Permission denied[/c]
What about this file existence and it's permissions?

Offline

#3 2015-08-28 21:46:07

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: Who can help me with smbclient (... or Windows ?)

Hi Aleksej,

Thanks to read me ;-)

I see reading error in your log:

[c]Enter shared's password:

tdb(/var/run/samba/gencache.tdb): tdb_open_ex: could not open file /var/run/samba/gencache.tdb: Permission denied[/c]

Yes, I noticed it too. But I think this is a file used by samba and not by smbclient.

I don't have this error when I'm root but the sentence is the same :-(

I forgot to mention that I don't see SAMBA in Explorator > Network but I can see MSNET and my box.

And if I run PyNeighborhood on SAMBA, I can see SAMBA, the box and not MSNET...

Offline

#4 2015-08-28 23:24:48

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Who can help me with smbclient (... or Windows ?)

@Ceel

Open these ports on MSNET:

$ pscan -cb -p 139 -P 139 MSNET

Scanning MSNET ports 139 to 139

Port    Proto    State    Service

  139    tcp    blocked netbios-ssn

0 closed, 0 open, 1 timed out (or blocked) ports

$ pscan -cb -p 445 -P 445 MSNET

Scanning MSNET ports 445 to 445

Port    Proto    State    Service

  445    tcp    blocked unknown

0 closed, 0 open, 1 timed out (or blocked) ports

Control Panel/Windows Firewall/General tab

If firewall is off something else is blocking the ports.

If firewall is on turn it off.

General tab/Tick off/Click OK

Verify the ports are open with pscan

If you want the windows firewall on make sure "Don't allow exceptions" is unchecked.

Windows Firewall/Exceptions tab/check the box next to File and Printer Sharing/click OK button.

Verify the ports are open with pscan

Winxp terminal commands

Enable/disable file and print sharing exception:

[c]netsh firewall set service FILEANDPRINT enable[/c]

[c]netsh firewall set service FILEANDPRINT disable[/c]

Disable/enable the firewall:

[c]netsh firewall set opmod disable[/c]

[c]netsh firewall set opmod enable[/c]

I get no error when smbclient is run by regular user.

Check that /var/run/samba/gencache.tdb has 644 permissions.

Offline

#5 2015-08-29 07:25:12

oui
Member
Registered: 2012-09-05
Posts: 298

Re: Who can help me with smbclient (... or Windows ?)

This stuff is essential for some users depending in there activities from transfer of a great number of files (not for me since years: I use dropbox and no problem any more - but I transfer only a few number of files, really)!

What is with our SliTaz Guides / Wikis?

Offline

#6 2015-08-29 15:59:20

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: Who can help me with smbclient (... or Windows ?)

@ mojo

If firewall is on turn it off.

Windows firewall is off but the antivirus firewall is on.

I've disconnected internet on the box then disabled the firewall and try

shared@SAMBA:~$ smbclient -L MSNET
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
    No such file or directory
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Enter shared's password:
Failed to load upcase.dat, will use lame ASCII-only case sensitivity rules
Failed to load lowcase.dat, will use lame ASCII-only case sensitivity rules
Domain=[MSNET] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

    Sharename       Type      Comment
    ---------       ----      -------
    Imprimante2     Printer   Microsoft XPS Document Writer
    samba           Disk
    IPC$            IPC       IPC distant
    print$          Disk      Pilotes d'imprimantes
    Imprimante      Printer   Canon Bubble-Jet BJ-200
    Linux           Disk
    AcrobatD        Printer   Acrobat Distiller
Domain=[MSNET] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

    Server               Comment
    ---------            -------

    Workgroup            Master
    ---------            -------
shared@SAMBA:~$
Yes, that's it! Now, the question is: is it reasonable to disable the firewall on a computer that is connected to internet? According to this, not sure.

I get no error when smbclient is run by regular user.

gencache.tdb error appears only in debug mode. Others you can see above exists when only smbclient is installed.

When installing smbclient, directories /etc/samba, /var/run/samba and /usr/lib/samba are not created -> no /etc/samba/smb.conf, /var/run/samba/gencache.tdb, /usr/lib/samba/upcase.dat and /usr/lib/samba/lowcase.dat files.

These messages won't appear when Samba will be installed.

But I can access to shared folders. That's why I think these files are only used by samba.

Maybe there is something missing in the packages installed with smbclient?

Thanks for your help.

Offline

#7 2015-08-29 16:57:46

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: Who can help me with smbclient (... or Windows ?)

@ Aleksej,

I've tested gvfs-smb. Cool.

Just enter smb://<SERVER_NAME>/<SHARED_DIR> and that's all (https://wiki.archlinux.org/index.php/Samba#GNOME_Files.2C_Nemo.2C_Caja.2C_Thunar_and_PCManFM).

Much better than smbbox (too much windows) and no need linux-cifs and cifs-utils packages.

Thanks for the hint.

[attachment=39023,1996]

Offline

#8 2015-08-29 17:05:44

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: Who can help me with smbclient (... or Windows ?)

@ oui

This stuff is essential for some users depending in there activities from transfer of a great number of files

I don't share your point of view. On LAN, I prefer to access directly to a computer from another one whithout to need internet. But dropbox is a good tool too.

What is with our SliTaz Guides / Wikis?

[*]
There is a good guide written by linea to start with it: http://doc.slitaz.org/en:guides:samba

Samba is really easy to implement (for a home network); I didn't meet any problems to install and use server and client on SliTaz machines. Now I have to go ahead with the configuration file and see if I can change some parameters for my firewall when Windows is running

[*]The french guide principaly concerns PyNeighborhood.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 1.57 MiB (Peak: 1.77 MiB) ]