Page 1 of 1

LAN File Sharing on AVLinux MX Edition

Posted: Thu Mar 09, 2023 10:53 am
by siabost9deas
Hi,

I have AVLinux MX Edition-21.3 installed on two PCs and I'm trying to share a folder between them using samba.
Can I figure it out - I can not!
I installed the MX-Samba-Config utility and set up my share folders and user with that - there's only one user i.e. me.
Going to 'Network' on either PC I can see the other but double-clicking on the icon/shortcut that should access the other PC produces nothing - nothing happens.
Does anyone know how file-sharing should be done? Do I have to manually edit the samba config file? And if so, how please?

Many thanks.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Thu Mar 09, 2023 11:08 am
by AVLinux
Hi,

I'm the AVL guy and networking is a huge blind spot for me admittedly, something I don't personally use much and something that gets very sporadic testing. That said I haven't knowingly messed with any of the MX or Debian file-sharing defaults..

If you type 'id' into a terminal are you a member of the 'sambashare' group?

What happens if you try sharing the Folder by right-clicking with the included Thunar samba Custom Actions?

Re: LAN File Sharing on AVLinux MX Edition

Posted: Thu Mar 09, 2023 11:28 am
by siabost9deas
Hi AVL Guy,

Tried to quick reply a moment ago but that seems to have disappeared.

I'll check the 'id' command next time I'm at one of the PCs - not sure how I can add myself to the sambashare group? There used to be a GUI for that on Gnome once upon a time.

Sharing via Thunar has no effect other than adding a nice 'share' icon to the relevant folder.

Thanks.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Thu Mar 09, 2023 12:41 pm
by AVLinux
Hi,

I did an experiment, if this helps

I created a folder called 'shared' in my home folder on my running PC (MXDE-EFL) using the MX Samba config utility, I did not add any Users which I believe it then defaults to the logged in User. I then booted AV Linux MX Edition from the Live ISO in VMWare and I opened Thunar in AVL and searched the Network and immediately saw the running MXDE PC server on it and when I clicked on the networked icon for MXDE the 'shared' folder showed up right away and I was able to open it, I set it up for the experiment as read-only so I didn't try and copy data back and forth. At least I could verify on the same network I was able to create and see a shared folder on one system and access from another.. To my knowledge things are working as they should, but I am no networking guru..

Perhaps others can better explain..
shot-2023-03-09_12-33-11.jpg

Re: LAN File Sharing on AVLinux MX Edition

Posted: Fri Mar 10, 2023 8:43 am
by siabost9deas
Hi AVLinux,

That 'share' link doesn't show up on my PCs, I'm afraid.
I checked again last night. I appear to be in the sambashare group as well, so that doesn't seem to be the problem.
I'm using a bog-standard NOW Broadband WiFi router which doesn't appear to be blockin anything locally.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Fri Mar 10, 2023 9:41 am
by AVLinux
@Huckleberry Finn
Any wisdom to impart? Setting up Samba shares appears to work for me between a host and VM guest but not working for the OP, I rarely network stuff and to my knowledge have not altered MX defaults..

Re: LAN File Sharing on AVLinux MX Edition

Posted: Fri Mar 10, 2023 10:47 am
by CharlesV
Make sure your samba service is running on both machines.

Code: Select all

sudo service smbd restart

Re: LAN File Sharing on AVLinux MX Edition

Posted: Fri Mar 10, 2023 10:49 am
by CharlesV
and please post your QSI for both machines as well as your samba config on the machine with the shares. ( /etc/samba/smb.conf )

Re: LAN File Sharing on AVLinux MX Edition

Posted: Fri Mar 10, 2023 10:51 am
by Huckleberry Finn
siabost9deas wrote: Thu Mar 09, 2023 11:28 am... not sure how I can add myself to the sambashare group? There used to be a GUI ...
"MX User Manager" from menu , Last tab: "Group Membership" .. select user ...

Re: LAN File Sharing on AVLinux MX Edition

Posted: Fri Mar 10, 2023 12:13 pm
by Huckleberry Finn
In the meantime I never tried this, but it may make everything easy:

https://ubunlog.com/en/lan-share-archivos-pc-pc/

https://github.com/abdularis/LAN-Share/ ... _amd64.deb

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sat Mar 11, 2023 4:54 pm
by siabost9deas
Hi @Huckleberry Finn
I'll check out that lanshare app.

My network looks a bit strange - shortcuts are duplicated (see attached screenshots). I am in the sambashare group.

Meantime

Code: Select all

testparm
:

Code: Select all

 AV Linux MX Edition
kenny@HP-Music-PC:~/Desktop
$ testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
	log file = /var/log/samba/log.%m
	logging = file
	map to guest = Bad User
	max log size = 1000
	obey pam restrictions = Yes
	pam password change = Yes
	panic action = /usr/share/samba/panic-action %d
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	passwd program = /usr/bin/passwd %u
	server role = standalone server
	unix password sync = Yes
	usershare allow guests = Yes
	idmap config * : backend = tdb


[homes]
	browseable = No
	comment = Home Directories
	create mask = 0700
	directory mask = 0700
	valid users = %S


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


[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sat Mar 11, 2023 6:15 pm
by siabost9deas
By contrast, I've discovered I can access both AVL MX computer shared folders from my Kubuntu laptop, though the reverse isn't possible. And I can send files from the Kubuntu laptop to the shared folders on the AVL MX PCs.
The Kubuntu samba.conf set-up (I had to add the 'client protocol = NT1' line to get access to my old dlink storage device):

Code: Select all

kenny@Kenny-Main-Laptop:~$ testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed

WARNING: The 'netbios name' is too long (max. 15 chars).

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        client min protocol = NT1
        log file = /var/log/samba/log.%m
        logging = file
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        server role = standalone server
        server string = %h server (Samba, Ubuntu)
        unix password sync = Yes
        usershare allow guests = Yes
        idmap config * : backend = tdb


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


[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sat Mar 11, 2023 6:44 pm
by CharlesV
I dont see any shared areas in your testparam ? did you chop off that part, or is nothing shared ?

also might be interesting to see what smbtree shows

Code: Select all

smbtree

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 5:03 am
by Huckleberry Finn
In the meantime there's also such a tiny, simple utility, ready in repos, if you like: https://www.tecmint.com/share-files-ove ... -in-linux/

Code: Select all

$ apt show woof
Package: woof
Version: 20091227-2.1
Priority: optional
Section: net
Maintainer: Andrea Gasparini <gaspa@yattaweb.it>

Installed-Size: 34.8 kB

Depends: python
Homepage: http://www.home.unix-ag.org/simon/woof.html
Tag: implemented-in::python, network::service, role::program, scope::utility,
 works-with::file

Download-Size: 9,324 B

APT-Sources: http://deb.debian.org/debian buster/main i386 Packages

Description: share files through HTTP protocol
 Woof (Web Offer One File) is a tool to copy files among hosts. It can serve a
 specified file on HTTP, just for a given number of times, and then exits.
 .
 It can be easily used to share files across the computers on a net, enough the
 other ends have just a browser (that means you can share things between
 different operating systems or different devices, even phones).
 .
 Features include:
  * it can share stuff "one shot" and exit just after he served that file.
  * it can share things among different operating system or different devices
    (e.g.: a smartphone), and allows one to upload files easily.
  * it can also show a simple html form in order to upload file (useful if the
    client hasn't a way to serve the file).
Edit: Oh, no, it seems to be available for Buster for the last time.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 6:22 am
by Huckleberry Finn
siabost9deas wrote: Sat Mar 11, 2023 6:15 pm... I can access both AVL MX computer shared folders from my Kubuntu laptop, though the reverse isn't possible. And I can send files from the Kubuntu laptop to the shared folders on the AVL MX PCs...
Then it may be something systemd-related.

You can try adding users to systemd-network group.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 4:07 pm
by FullScale4Me
Let me break this down into a few easily digestible steps. On all hosts that you have shares setup do the following:

1) open a console window and enter: 'smbclient -L localhost' without ' ' s. Example of a session is below.

Code: Select all

mike@HP-P2-1394:~
$ smbclient -L localhost
Enter WORKGROUP\mike's password: 

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        IPC$            IPC       IPC Service (Samba 4.13.13-Debian)
        HL2380DW        Printer   B&W Laser Printer
        LinuxISO        Disk      
SMB1 disabled -- no workgroup available
mike@HP-P2-1394:~
In this output, the user-defined share is 'LinuxISO'

2) Verify the share is permissioned correctly and it's owner has a SMB password set in the MX Samba Config Applet. Do this on all Linux hosts sharing files. See HELP: MX SAMBA CONFIG

Why check this way? This sidesteps all current File Manager and UFW firewall known behaviors.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 4:28 pm
by FullScale4Me
Next, get the IP address of all PCs by typing hostname -i in a command window. Write them down for the next step. Example below.

Code: Select all

mike@HP-P2-1394:~
$ hostname -i
fe80::99b4:ac30:b529:b9bb%eth0 192.168.1.119
mike@HP-P2-1394:~
In the example above this PCs IP address is 192.168.1.119

As before using a command window, this time to provide further visibility to connection errors.

The 192.168.1.114 following the -L is the IP address of the remote PC. The Workgroup password is the smb user ID/Account Password for, in this example the 'mike' user ID/Account.

Enumerating a remote share on Linux with the smbclient utility; in this case, the share is called 'Downloads'. From a command prompt:

Code: Select all

$ mike@HP-P2-1394:~smbclient -U mike -L 192.168.1.114
Enter WORKGROUP\mike's password: 

        Sharename       Type      Comment
        ---------       ----      -------
        Downloads       Disk      
        IPC$            IPC       Remote IPC
        Users           Disk      
        
 mike@HP-P2-1394:~
The share 'IPC$' is configured by SaMba (by default) to be network visible but is NOT (accessible) shared by default. The share users should be visible network-wide.

Change the IP address in the command to see each individual remote PC. All of this giving no errors should be reproducible in Linux File Managers.

Windows remote PCs will have two additional shares (ADMIN$ Disk Remote Admin) and (C$ Disk Default share) neither can be connected to by Linux hosts without extra effort.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 4:47 pm
by FullScale4Me
Errors found in the 'localhost' test are primarily associated with share creation (form or designed but not saved) by the user.

The IP address test failing (but localhost test passing) points to:

1) The owner of the share not having an SMB password.

2) permissions of the share not set correctly (all denied access, owned by a user not specified in the above test, etc) Revisit the instructions HELP: MX SAMBA CONFIG

3) a firewall on either the share PC or the one doing the IP Address test blocking the connection.

In my experience 1 will fail silently with 2 & 3 resulting in errors on the screen in the terminal. Connection timeout/refused error: run the UFW applet, click rules, type samba in the search, and apply/OK your way out.

Below can be read or ignored...
Samba will auto-negotiate protocol without a need to force anything in its config; Left on its own it will connect with SMB3_02 to Windows 10/Windows 11 and SMB2_02 to most Linux-enabled hosts/devices.

Forcing SMB protocol lower adds a tremendous reduction of file transfer speed (as much as 90%) and opens exposure to Malware such as WannaCry and similar SMB-based evilness.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 6:41 pm
by siabost9deas
@CharlesV

Code: Select all

smbtree
on one of the AVLinux seems to reveal an error, if I read it correctly ('No compatible protocol selected by server')?

Code: Select all

 AV Linux MX Edition
kenny@HP-Music-PC:~
$ smbtree
Enter WORKGROUP\kenny's password: 
WORKGROUP
	\\               		Kenny-Main-Laptop server (Samba, Ubuntu)
		\\\               	Kenny-Main-Laptop server (Samba, Ubuntu)
		\\\DLINK-SHARE    	DNS-320L
		\\\HP-MUSIC-PC    	Samba 4.13.13-Debian
	\\DLINK-SHARE    		DNS-320L
		\\DLINK-SHARE\Volume_1       	
		\\DLINK-SHARE\IPC$           	IPC Service (DNS-320L)
		\\DLINK-SHARE\lp             	USB Printer
	\\HP-MUSIC-PC    		Samba 4.13.13-Debian
smbXcli_negprot_smb1_done: No compatible protocol selected by server.
smbc_opendir: Invalid argument

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 6:50 pm
by siabost9deas
Hi @FullScale4Me,

Thanks for all that. I will need to try it all later as I have run out of time tonight.

I have set an smb password on all relevant machines.

I will report back. Thanks.

Re: LAN File Sharing on AVLinux MX Edition

Posted: Sun Mar 12, 2023 6:55 pm
by siabost9deas
@FullScale4Me,

A similar warning to

Code: Select all

smbtree

Code: Select all

kenny@HP-Music-PC:~
$ smbclient -L localhost
Enter WORKGROUP\kenny's password: 

	Sharename       Type      Comment
	---------       ----      -------
	print$          Disk      Printer Drivers
	IPC$            IPC       IPC Service (Samba 4.13.13-Debian)
	kenny           Disk      Home Directories
	Music-Share     Disk      
	Public-share    Disk      
	Public          Disk      
Reconnecting with SMB1 for workgroup listing.
smbXcli_negprot_smb1_done: No compatible protocol selected by server.
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
Unable to connect with SMB1 -- no workgroup available

Re: LAN File Sharing on AVLinux MX Edition

Posted: Mon Mar 13, 2023 12:29 am
by FullScale4Me
I noticed in your previous post in this thread that you had two Ubuntu PCs.

I just did some testing (with smbclient) in Virtual Box with Ubuntu 22.10 (desktop ed). If the login account has NOT been added to the SMB id database AND a SMB password set it will throw an error rather than list shares, even in a local context --- '....NT_STATUS_IO_TIMEOUT...' stands out.

Extraneous technobabble only a programmer could love deleted from the error message (the leading ... and trailing ...). Yeah, 'old school' editing form, what I was taught in the mid-'60s!

Re: LAN File Sharing on AVLinux MX Edition

Posted: Mon Mar 13, 2023 12:37 am
by CharlesV
siabost9deas wrote: Sun Mar 12, 2023 6:41 pm @CharlesV

Code: Select all

smbtree
on one of the AVLinux seems to reveal an error, if I read it correctly ('No compatible protocol selected by server')?

Code: Select all

 AV Linux MX Edition
kenny@HP-Music-PC:~
$ smbtree
Enter WORKGROUP\kenny's password: 
WORKGROUP
	\\               		Kenny-Main-Laptop server (Samba, Ubuntu)
		\\\               	Kenny-Main-Laptop server (Samba, Ubuntu)
		\\\DLINK-SHARE    	DNS-320L
		\\\HP-MUSIC-PC    	Samba 4.13.13-Debian
	\\DLINK-SHARE    		DNS-320L
		\\DLINK-SHARE\Volume_1       	
		\\DLINK-SHARE\IPC$           	IPC Service (DNS-320L)
		\\DLINK-SHARE\lp             	USB Printer
	\\HP-MUSIC-PC    		Samba 4.13.13-Debian
smbXcli_negprot_smb1_done: No compatible protocol selected by server.
smbc_opendir: Invalid argument
So it looks like your two computers have different samba protocols and cannot talk to each other. I saw no server protocol specified, so it probably went to SMB3.. I think I would try in both computers /etc/samba/smb.conf files setting, I use:

Code: Select all

  workgroup = CEO
   client min protocol = COREPLUS
   server max protocol = SMB3
   name resolve order =  host wins bcast lmhosts 
   wins support = yes


I also always set my host files to show my machines I want to look at, I find it works faster and is stable ! But supposedly the proper name resolve is

Code: Select all

 name resolve order =  bcast wins host lmhosts


Also, I dont see any drives shared on your computers, and according to the samba docs, it will ONLY activate as a server if you have one or more shares.