You are not logged in.

#1 2021-11-24 01:25:42

aksilarch
Member
Registered: 2021-09-15
Posts: 51

LAN discovery/fileshare

Hi,

For the past few hours I've been really struggling to try and make things work out and it's a mess.

My goal is connect to a local network and explore the machines that are shared (their shared files) and connected to the same network (I'm using thunar file manager). I want to be able to explore and discover all machines that are on the network when clicking on "Browse Networks" whether they are on Windows or Linux (same as Windows when you browse discoverable machines on the network which I assume is through ftp) and let them have access to my shared files as well.

I tried setting up samba and I failed miserably, I don't really know where to start again.

I'd really appreciate some guidance, I undo-ed everything I did.

Ty all


archlinux cures my depression.

Offline

#2 2021-11-24 07:41:21

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: LAN discovery/fileshare

explore the machines that are shared …  whether they are on Windows or Linux … I tried setting up samba

So far, so good.

I failed miserably, I don't really know where to start again

https://wiki.archlinux.org/title/Samba
You'll have to be a bit more elaborative on your miserable failures in doing so.
For the start, I'd ignore thunar and make smbclient work, https://wiki.archlinux.org/title/Samba# … lic_shares

Offline

#3 2021-11-24 13:55:10

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: LAN discovery/fileshare

if your using thunar make sure you have "gvfs-smb" installed, but yes we need more info on what you've done so far

Offline

#4 2021-11-25 14:01:59

aksilarch
Member
Registered: 2021-09-15
Posts: 51

Re: LAN discovery/fileshare

Sorry for the late reply guys.

So, after a clean install of Samba and creating a smbuser and a smbgroup, here's my smb.conf and shares.conf (included in smb.conf):

smb.conf:

[global]
server string = File Server
workgroup = WORKGROUP
security = user
map to guest = Bad user
name resolve order = bcast host
include = /etc/samba/shares.conf

shares.conf:

[Public Files]
path = /share/public_files
force user = smbuser
force group = smbgroup
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
writable = yes

[Protected Files]
path = /share/private_files
force user = smbuser
force group = smbgroup
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
writable = no

After this configuration, I can access the files on another Windows machine connected to the LAN by entering their local IP address as such in thunar: "smb://192.168.*.*" however, the Windows machine cannot access my shares (my machine does not even show on their File Explorer, Network tab).

The output on Windows' end when they use the prefix "ftp://host" is that there is a wrong filename, or unavailable resource? (even though on my machine it works perfectly fine I can clearly see Public Shares and Private Shares files) and the prefix "smb://host" is that they need to download some kind of a program (the SMB functionalities is enabled on Windows).

However, this is not my goal, my goal is to be able for all the machines that are connected to the LAN to automatically show on the "Browse Networks" tab in thunar.

(I installed thunar-shares-plugin but I still can't use it as it's still prompting me to install Samba while I already have it installed).

Lastly,

smbtree -b -N

doesn't work, the "-b" parameter is not recognized (for broadcast) as per indicated here: https://wiki.archlinux.org/title/Samba# … lic_shares

Ty all

Last edited by aksilarch (2021-11-25 14:03:21)


archlinux cures my depression.

Offline

#5 2021-11-25 14:19:36

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: LAN discovery/fileshare

once again make sure "gvfs-smb" is installed for thunar "browse network" to work.

also try this smb.conf:

[global]
	client min protocol = NT1
	min protocol = NT1
	workgroup = WORKGROUP
	server string = File Server
	security = user
	map to guest = Bad User
	guest ok = yes
[share]
   comment = share
   path = /path/to/share
   public = yes
   writable = no
   printable = no

if that works then try adding in your force user and default mask settings

Offline

#6 2021-11-25 14:28:51

aksilarch
Member
Registered: 2021-09-15
Posts: 51

Re: LAN discovery/fileshare

jonno2002 wrote:

once again make sure "gvfs-smb" is installed for thunar "browse network" to work.

also try this smb.conf:

[global]
	client min protocol = NT1
	min protocol = NT1
	workgroup = WORKGROUP
	server string = File Server
	security = user
	map to guest = Bad User
	guest ok = yes
[share]
   comment = share
   path = /path/to/share
   public = yes
   writable = no
   printable = no

if that works then try adding in your force user and default mask settings

Yes, I had installed gvfs-smb already, I've edited my smb.conf and now I can see the machines, but on click, nothing happens, can't access them still.


archlinux cures my depression.

Offline

#7 2021-11-25 14:38:49

aksilarch
Member
Registered: 2021-09-15
Posts: 51

Re: LAN discovery/fileshare

Here's the new smb.conf:

[global]
client min protocol = NT1
min protocol = NT1
server string = File Server
workgroup = WORKGROUP
security = user
map to guest = Bad user
guest ok = yes
name resolve order = bcast host

[share]
comment = share
path = /share/public_files
force user = smbuser
force group = smbgroup
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
writable = yes
printable = no

archlinux cures my depression.

Offline

#8 2021-11-25 14:44:34

aksilarch
Member
Registered: 2021-09-15
Posts: 51

Re: LAN discovery/fileshare

"smb://host" is not working as well now.

Last edited by aksilarch (2021-11-25 14:44:44)


archlinux cures my depression.

Offline

#9 2021-11-25 14:52:03

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: LAN discovery/fileshare

did you try the config i posted without all the extra stuff you've added ?

also try closing thunar and killing gvfsd-smb-browse then re-open thunar and try "browse network" again

pkill gvfsd-smb-browse

Offline

#10 2021-11-25 15:26:54

aksilarch
Member
Registered: 2021-09-15
Posts: 51

Re: LAN discovery/fileshare

jonno2002 wrote:

did you try the config i posted without all the extra stuff you've added ?

also try closing thunar and killing gvfsd-smb-browse then re-open thunar and try "browse network" again

pkill gvfsd-smb-browse

Yes, same problem.


archlinux cures my depression.

Offline

#11 2021-11-25 15:28:36

aksilarch
Member
Registered: 2021-09-15
Posts: 51

Re: LAN discovery/fileshare

Here's how it looks:

Deepin-Screenshot-select-area-20211125162756.png


archlinux cures my depression.

Offline

#12 2021-11-25 15:40:49

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: LAN discovery/fileshare

Please stop bumping, edit your posts if nobody has yet replied.

smb:// isn't anything that would by default work on windows and ftp:// is the wrong protocol.
https://superuser.com/questions/1064142 … on-windows

Try creating an anonymous share first (as suggested by jonno2002 and described at https://wiki.archlinux.org/title/Samba# … mous_share )

Offline

#13 2021-11-25 15:41:46

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,794
Website

Re: LAN discovery/fileshare

I solved this with 2 these in [global] on all samba servers and clients

server min protocol = NT1
ntlm auth = yes

Last edited by ugjka (2021-11-25 15:42:02)


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#14 2021-11-25 15:45:05

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: LAN discovery/fileshare

glad you fixed it but "server min protocol" is the same as "min protocol" which is in my config and "ntlm auth" should not matter for public/guest access as per my config.

[EDIT] o wait thats not the same person.... ill continue with what i was going to post then.....

what happens when you run

smbtree

and just press enter when it asks for password.... for some reason it errors out with the -N flag (unless thats fixed now, i havent updated in a while)

also

smbclient -L pc-name

again just press enter when asked for password

see if either of those work..... with the config i posted of course

Last edited by jonno2002 (2021-11-25 15:47:27)

Offline

#15 2021-11-25 16:03:54

aksilarch
Member
Registered: 2021-09-15
Posts: 51

Re: LAN discovery/fileshare

seth wrote:

Please stop bumping, edit your posts if nobody has yet replied.

smb:// isn't anything that would by default work on windows and ftp:// is the wrong protocol.
https://superuser.com/questions/1064142 … on-windows

Try creating an anonymous share first (as suggested by jonno2002 and described at https://wiki.archlinux.org/title/Samba# … mous_share )

Gotcha, mb. And I see that it wouldn't work by default that's why I mentioned enabling some windows features, and I did create a guest user.

As for:

jonno2002 wrote:

what happens when you run

smbtree

and just press enter when it asks for password.... for some reason it errors out with the -N flag (unless thats fixed now, i havent updated in a while)

also

smbclient -L pc-name

again just press enter when asked for password

see if either of those work..... with the config i posted of course

Here's the output with your config:

$ smbtree
Password for [WORKGROUP\aksil]:
WORKGROUP
	\\ARCH           		File Server
		\\ARCH\share          	share
		\\ARCH\guest          	guest
		\\ARCH\IPC$           	IPC Service (File Server)
	\\HP

smbclient on host my machine:

$ smbclient -L arch
Password for [WORKGROUP\aksil]:

	Sharename       Type      Comment
	---------       ----      -------
	share           Disk      share
	guest           Disk      guest
	IPC$            IPC       IPC Service (File Server)
Reconnecting with SMB1 for workgroup listing.

	Server               Comment
	---------            -------
smb1cli_req_writev_submit: called for dialect[SMB3_11] server[arch]

	Workgroup            Master
	---------            -------
smb1cli_req_writev_submit: called for dialect[SMB3_11] server[arch]

smbclient on host windows machine:

$ smbclient -L hp
Password for [WORKGROUP\aksil]:
session setup failed: NT_STATUS_ACCESS_DENIED

Last edited by aksilarch (2021-11-25 16:05:19)


archlinux cures my depression.

Offline

#16 2021-11-25 16:35:07

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: LAN discovery/fileshare

well im sorry im out of ideas...
i just tried that exact same config in a barebones arch VM (just samba running with that config on top of a bare arch install) and it worked perfect, my media pc with thunar can access it via "browse network" and my laptop can see it via "smbtree" and "smbclient" and mount the share via my samba mount script i wrote.
also that VM can see all other pc's on my network via "smbtree" and can list my shares on my laptop via "smbclient -L my-pc-name"

Offline

#17 2021-11-25 16:51:55

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,794
Website

Re: LAN discovery/fileshare

If all your samba shares are on linux, try avahi


https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...

Offline

#18 2021-11-25 16:55:16

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: LAN discovery/fileshare

He's trying to connect from windows and there you'd actually need SMB3 as minimum protocol.
https://wiki.archlinux.org/title/Samba# … r_security

Also, again: try an anonymous share first.

Offline

Board footer

Powered by FluxBB