[SOLVED] Can't connect to Samba share

[SOLVED] Can't connect to Samba share

Postby kateto » Nov 23rd, '21, 23:46

Hello,
I can't seem to connect to a Samba share from Mageia 8. It's a hard drive plugged into the USB port of the Sagemcom Fast 3686 router. On Windows XP it appears as a Samba 3.0.17 share on a Windows NT 4.9 server and I can access it, but on Diskdrake the server appears without showing any share. The whole drive is shared and no username is required.
Here's what I get when using smbclient:
Code: Select all
smbclient -L sagem_router
protocol negotiation failed: NT_STATUS_CONNECTION_DISCONNECTED

I've tried changing the protocol too:
Code: Select all
smbclient -L sagem_router -m SMB2
protocol negotiation failed: NT_STATUS_CONNECTION_DISCONNECTED
smbclient -L sagem_router -m NT1
lp_load_ex: Max protocol NT1 is less than min protocol SMB2_02.
protocol negotiation failed: NT_STATUS_INVALID_PARAMETER_MIX

Here's part of my smb.conf:
Code: Select all
[global]

# ----------------------- Network-Related Options -------------------------
#
# workgroup = the Windows NT domain name or workgroup name, for example, MYGROUP.
#
# server string = the equivalent of the Windows NT Description field.
#
# netbios name = used to specify a server name that is not tied to the hostname.
#
# interfaces = used to configure Samba to listen on multiple network interfaces.
# If you have multiple interfaces, you can use the "interfaces =" option to
# configure which of those interfaces Samba listens on. Never omit the localhost
# interface (lo).
#
# hosts allow = the hosts allowed to connect. This option can also be used on a
# per-share basis.
#
# hosts deny = the hosts not allowed to connect. This option can also be used on
# a per-share basis.
#
# max protocol = used to define the supported protocol. The default is NT1. You
# can set it to SMB2 if you want experimental SMB2 support.
#
        workgroup = MYGROUP
        server string = Samba Server Version %v

;       netbios name = MYSERVER

;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
;       hosts allow = 127. 192.168.12. 192.168.13.

;       max protocol = SMB2

What should I try next?
Last edited by kateto on Dec 9th, '21, 08:12, edited 2 times in total.
kateto
 
Posts: 61
Joined: Jul 31st, '12, 13:00

Re: Can't connect to Samba share

Postby sturmvogel » Nov 24th, '21, 00:26

You should add following part to your smb.conf:
Code: Select all
client min protocol = SMB2
client max protocol = SMB3


After changes of your smb.conf you should also check the syntax with the testparm program from a terminal.
https://www.samba.org/samba/docs/current/man-html/testparm.1.html

Restart your samba service afterwards.
Code: Select all
sudo service smbd restart



And why are there ";" in your smb.conf?
sturmvogel
 
Posts: 678
Joined: Jul 30th, '12, 00:39

Re: Can't connect to Samba share

Postby kateto » Nov 25th, '21, 00:04

I did everything as you said. No result. It's all the same. Same problems, same error, even after restarting Mageia. By the way, the service smbd doesn't exist here (just like sudo).
Here's the results of testparm:
Code: Select all
testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        client max protocol = SMB3
        client min protocol = SMB2
        log file = /var/log/samba/log.%m
        max log size = 50
        security = USER
        server max protocol = NT1
        server string = Samba Server Version %v
        idmap config * : backend = tdb
        cups options = raw

[homes]
        browseable = No
        comment = Home Directories
        read only = No

[printers]
        browseable = No
        comment = All Printers
        path = /var/spool/samba
        printable = Yes

By the way, I have no idea why some sections of smb.conf are commented out. I never touched it, I showed it just as I found it.
kateto
 
Posts: 61
Joined: Jul 31st, '12, 13:00

Re: Can't connect to Samba share

Postby sturmvogel » Nov 25th, '21, 00:43

The only thing what i see is following: You now set the samba protocol for the client to min version 2 and max version 3. But your server is set to version NT1. In that way client and server can't communicate. You should also do the same setting for the server samba protocol as for the client. That means:
Code: Select all
server min protocol =SMB2
server max protocol = SMB3
sturmvogel
 
Posts: 678
Joined: Jul 30th, '12, 00:39

Re: Can't connect to Samba share

Postby kateto » Nov 25th, '21, 08:57

Do you mean modifying the settings at the server? I can't, as I wrote it's a router and everything is hardcoded in my ISP's firmware, I can't even decide when to update it, it does it by itself.
However, if the server can only talk NT1, shouldn't I rather put this into my smb.conf?
Code: Select all
client min protocol = NT1

By the way, now I'm in doubt whether we're doing the right thing; does smb.conf control how my machine connects to a Samba server, or rather only how it would work as a server? To make things double clear, let's remember that in my case Mageia is the client, not the server.
kateto
 
Posts: 61
Joined: Jul 31st, '12, 13:00


Re: Can't connect to Samba share

Postby doktor5000 » Nov 25th, '21, 18:22

kateto wrote:By the way, now I'm in doubt whether we're doing the right thing; does smb.conf control how my machine connects to a Samba server, or rather only how it would work as a server?

The latter, smb.conf is usually only the configuration for the server. Although the client (whether you use smbclient or e.g. mount -t cifs) usually supports the same basic options.

See e.g. https://www.samba.org/samba/docs/curren ... ent.1.html for the client part and https://www.samba.org/samba/docs/curren ... onf.5.html for the server part.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Can't connect to Samba share

Postby kateto » Dec 2nd, '21, 19:51

Thanks for pointing to the wiki but I'm still stuck. Cifs-utils is installed, but I can't mount the share unless I know its name, that's why I was trying to browse shares with smbclient, which keeps spitting the same errors.
kateto
 
Posts: 61
Joined: Jul 31st, '12, 13:00

Re: Can't connect to Samba share

Postby doktor5000 » Dec 2nd, '21, 23:41

kateto wrote:smbclient -L sagem_router -m NT1
lp_load_ex: Max protocol NT1 is less than min protocol SMB2_02.
protocol negotiation failed: NT_STATUS_INVALID_PARAMETER_MIX[/code]


Your client min protocol is set to v2 in smb.conf whereas you would need to set it to 1 if you want to use a lower one, as you already mentioned via "client min protocol = NT1"
IIRC you cannot override the global settings from smb.conf even if you only use smbclient as client.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Can't connect to Samba share

Postby kateto » Dec 5th, '21, 23:48

As I imagined, adding "client min protocol = NT1" to smb.conf allowed smbclient to connect. A nice benefit is that now Dolphin can see and browse the share too, because I specified the workgroup WORKGROUP in smb.conf.

In fact, I could've get the share name more easily with command smbtree. And once I know the share name I can mount it without touching smb.conf at all, with this command:
Code: Select all
mount -t cifs //SAGEM_ROUTER/VECTO_TACENS-6A1DC30A3A6 /mnt/vodafone -o guest,vers=1.0

This way I can move files to the share. However, Dolphin complains that it hasn't permissions, although the file actually gets moved.
Which would be the best options to mount this share in a single-user scenario? Should I use "uid=1000" and "gid=1000"?
kateto
 
Posts: 61
Joined: Jul 31st, '12, 13:00

Re: Can't connect to Samba share

Postby doktor5000 » Dec 6th, '21, 22:33

Why mount it as guest when you have control over both the samba server and the client mounting it ? Yes you should definitely mount it as a user and/or group who has regular write access to the share.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Can't connect to Samba share

Postby kateto » Dec 9th, '21, 08:11

Well, actually the server allows guest access, so I can write to it through Dolphin even without mounting it, which doesn't cause the permission error. The "guest" option merely skips the password prompt. And since the file system on the harddrive is NTFS, anything would appear to Linux with world-writable permissions anyway. So I mark this thread as solved.
kateto
 
Posts: 61
Joined: Jul 31st, '12, 13:00


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron