Page 1 of 1
The Samba Wiki entry
Posted: Mon Aug 25, 2025 7:11 am
by Jerry3904
<Beginning to think about MX-25 MXUM>
Having never used Samba in my life I'm unable to judge whether this entry is still valid and clear:
https://mxlinux.org/wiki/help-files/hel ... ba-config/
I'm asking b/c a couple of people in the FB Group have posted about having trouble.
TIA
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 10:23 am
by beardedragon
I think it as easy to use as Calamares, no problems here.
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 10:53 am
by dolphin_oracle
what usually trips people up is the following:
1. share browsing may not work
2. permissions on the underlying linux filesystem are still in play no matter what you do with samba, whether our share tool is used or not.
the tool has nothing to do with 1. it just makes share available. user's might need to direct address to access them. (smb://$SERVERNAME/$SHARENAME)
I know I gave up on share browsing long ago, even in pure windows environments.
The help file is still accurate for the mx-samba-config tool, but it is not a general samba document.
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 11:05 am
by Jerry3904
Thanks to both.
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 5:30 pm
by FullScale4Me
See a How-to and fixes for common pitfalls in using Samba. Read level - beginner to Linux. I am the author. Last updated February 23, 2025.
Using Samba File Sharing in MX Linux
PDF, illustrated, 10 pages, 485 Kb.
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 6:22 pm
by FullScale4Me
Jerry3904 wrote: Mon Aug 25, 2025 7:11 am
<Beginning to think about MX-25 MXUM>
Having never used Samba in my life I'm unable to judge whether this entry is still valid and clear:
https://mxlinux.org/wiki/help-files/hel ... ba-config/
I'm asking b/c a couple of people in the FB Group have posted about having trouble.
TIA
Top 3 root casual actions/inactions
The highest likely root cause is the UFW aka firewall being enabled by default. Impacts highly both Linux and Windows.
Second, likely is they used they used File Manager (or /etc/samba/smb.conf via internet how-to) and NOT the MX Samba Config app. This also won't lead them to the Wiki, best in MX User Manual.
Thirdly, somewhat related to the above, is not setting a smb user password. If Samba Config refused to make a share until a password is set, this would reduce this a lot IMHO.
Linux
The assumption about Network Browsing Windows hosts in the Linuxes File Manager persists. FWIW, Windows shares haven't appeared in the Network --> Windows in ages. When they do appear (not consistent) it is in the Network (SMB on KDE) folder. The distro whose name sounds like a grandpa's hat removed the Windows folder entirely. Some Linuxes have gelded their File Managers by removing/not including the sharing helper bits (mostly MATE flavors). The helper app WSDD (and its variants) when added to Linuxes returns most to all of the browsing of Linux hosts in Windows.
Windows
On the Windows side, in a distant fourth place is NOT enabling a one click feature ('Network Discovery' and 'File Sharing') to help Samba. The very first time you click on ‘Network’ in ‘Windows File Manager’ you will be prompted to turn on both 'Network Discovery' and 'File Sharing'. Sadly, it is a
one time prompt. If they dismiss it, we hear about it. Enabling it sets up Windows firewall rules, network routing and enables several services to allow other hosts (Windows & Linux) to 'discover' Windows shares/printers. For some reason Linuxes 'seeing' Windows in Network browsing isn't 100% for why I'm not entirely sure. Mostly firewalls IMHO.
WSDD
MX Linux 21 with the addition of WSDD (packaged by Tim) allowed MX 21 hosts to be seen on Windows PCs in Windows Explorer network browsing. Not sure when in 23 it stopped working. I think I/others mentioned it here 1–2 times. Ubuntu has split WSDD into a client and a server function (it can't do both simultaneously) as my guess is to supplant the File Browser share functionality. Client - 'wsdd' and server - 'wsdd-server'.
@CharlesV has more 'time in' with configuring wsdd than me.
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 6:53 pm
by Jerry3904
Very helpful, will mine the post for Wiki nuggets.
Thanks.
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 8:33 pm
by CharlesV
@FullScale4Me to be honest, I found wsdd flaky as hell and gave up on it. ( It seems to be problem all over.)
I struggled as well with Avahi and finally gave up on it as well.
My fix was
a) promote a Windows Master Browser on a VM and have it talk directly to my router to create a WINS system, ( I can get this to work reliable, but the my router is the key with cached wins entries and that isnt a good fix for most people.)
__or__
b) Create a script using a custom search with nmap, and bounce me back a list of machines available on the network.
_1) Run the results of nmap through a script that pushes out a file with links to the machines, then
_2) push the file into Featherpad and use Ctrl+Click to open the shares on the machine.
I was working on getting it all smoother, and nicer, but I got sidetracked and still use this bare bones when I have too.
The only other thing that *really* works .. is to downgrade the SMB protocols so that the browsing can happen ;-/
Re: The Samba Wiki entry
Posted: Mon Aug 25, 2025 9:15 pm
by CharlesV
I should note.. my script works and provides a method to connect up to any machine on my network.
I will work on the interface portion of it in the next few days and see if I can get it looking / working better
Re: The Samba Wiki entry
Posted: Tue Aug 26, 2025 6:12 am
by Jerry3904
That would be terrific, thanks.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 5:38 am
by BitterTruth
Samba does not have a Network Discovery Server. So you need to install avahi (if you have a linux only networks).
@dolphin_oracle install avahi-daemon on both server and clients. They'll be discoverable in the browsers (thunar then at least)
linux <------------------->linux
For Windows, you need:
WSDD
Web Service Discovery host daemon. This enables (Samba) hosts, like your local NAS device, to be found by Web Service Discovery Clients like Windows.
It also implements the client side of the discovery protocol which allows to search for Windows machines and other devices implementing WSD. This mode of operation is called discovery mode.
It goes without saying that samba, avahi and wsdd need to enabled and set to start on boot AND that you have the same WORKGROUP name set in the smb.conf file.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 9:22 am
by CharlesV
You do not *need* to install avahi for Samba to work. Samba has discovery methods and will find other samba machines if they are all configured properly.
The issue with window machines is different and wsdd is seriously flaky.
I am almost done with my SMB network scanning script and will post it in the next couple of days - I just tacked on nicer ui connection and should have it thoroughly tested by late today.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 11:45 am
by BitterTruth
CharlesV wrote: Wed Aug 27, 2025 9:22 am
You do not *need* to install avahi for Samba to work.
agreed. but to make it discoverable you will at least that's what I had to do to get a void vm to be able to see an alpine vm share in thunar. Don't get me wrong, I could access the share by typing:
smb://ip-address-of-samba-server
but it wasn't visible until I had avahi installed on both.
CharlesV wrote: Wed Aug 27, 2025 9:22 am
Samba has discovery methods and will find other samba machines if they are all configured properly.
I'd be curious to know what those are. The documentation is all over the place on samba with all sorts of configurations floating around. Some sources say it supports discovery independantly whilst others mention that it is compatible with network discovery tools.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 4:27 pm
by FullScale4Me
BitterTruth wrote: Wed Aug 27, 2025 11:45 am
CharlesV wrote: Wed Aug 27, 2025 9:22 am
Samba has discovery methods and will find other samba machines if they are all configured properly.
I'd be curious to know what those are. The documentation is all over the place on samba with all sorts of configurations floating around. Some sources say it supports discovery independantly whilst others mention that it is compatible with network discovery tools.
Avahi (and
bonjour too) is very configurable and has a low dependency impact as a
mDNS service. I'm surprised more Linux distro's haven't leveraged it now that Windows is mDNS compliant. Not a 'full-featured' discovery mechanism (as Debian configures it) as some would want (for network browsing) but as configured it at least obfuscates the IP to name resolution dilemma for the laypersons.
BitterTruth wrote:I could access the share by typing: smb://ip-address-of-samba-server
Bookmarking after that in File Manager eliminates all future fiddling to find other hosts as it restores the single click (in File Manager) to remote PCs/devices that laypersons crave.
Samba's legacy name resolution and browsing info broadcast messages were depreciated heavily in the Samba 4.11 Samba
transition. This was a part of the dropping of SMB1 aka NT1 (and lower) [1] protocol support.
What replaced NT1 was SMB2 and later SMB3. Both are faster (compressed data streams), more secure and (by design) more reliable due to using TCP only. Current implementations only use TCP port 445 with a teeny leak of whispers on UDP 137 if nmbd is installed and running. Going 'back' means a lot [more] of things to watch after. MOST of the common exploits that attack a PC with methods that run before the OS loads propagate locally via SMB1, many times bricking a PC firmware. Don't go there unless you can afford the risk!
KDE >5,27 has built their own 'Network Discovery' underlying subpart of the modules supporting Dolphin that is Microsoft (Win Vista and later)
WS-Discovery Service aware. Even Linuxes running SMB 3.x are seen too.
1) SMB1 aka NT1 was a later protocol. What It succeeded: LANMAN2 (Win 98/Win 98SE/Win Me/Win XP), LANMAN1 (Win 95) and CORE & COREPLUS (Window for Workgroups 3.1x/VAX Pathworks/IBM Server).
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 5:28 pm
by CharlesV
With the exception of windows machines, I have had no issues with 'browsing' on a samba network. All discovery is built into samba already.
I have four mods to the smb.conf file I do to ALL machines I setup:
1) workgroup = {network_work_group|
2) name resolve order = bcast lmhosts host wins
3) wins support = yes
4) Setup the Shares I want - either using the smb.conf file since I am in there or with the MX Samba utility.
Restart smbd and nmbd services and turn OFF the firewall. (sudo ufw disable )
Test.
If I need the firewall up, then I open the samba ports and test.
ALL my machines POP on this networ - mainly because of the name resolve order. And if I need browsing on a windows machine, then I use my script.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 6:25 pm
by BitterTruth
CharlesV wrote: Wed Aug 27, 2025 5:28 pm
Restart smbd and nmbd services and turn OFF the firewall. (sudo ufw disable )
It seems to me you are using the older deprecated NETBIOS since you have nmbd service running. I bet if you disabled that at boot your shares would no longer be browseable. It is also why your shares are not visible on windows since windows 10 stopped using netbios and uses mdns.
Samba uses mdns but only to announce it's hostname. It doesn't broadcast it's shares. Hostname lookup and service discovery are 2 subtley distinct parts of 'discovery'. So samba does multicast but only half.
That's why it 'needs' avahi or something similar to do the rest (service discovery).
Windows mdns does the service discovery but not the hostname lookup.
that's why linux needs wsdd so that windows clients can discover samba hosts.
Putting all this together:
Summary:
1) Samba + Netbios + smbd + nmbd -----------> discoverable by some linux and older windows
2) Samba + smbd only + avahi --------------> discoverable linux, mac
3) Samba + smbd + avahi + wsdd -----------------> discoverable by linux, mac, windows
Easy to test:
1) Stop nmbd
2) install and set avahi to start at boot (servers and clients)
3) install and set wsdd to start at boot (server only)
4) edit smb.conf to make sure user is allowed to access shares
5) disable firewall
6) should be browseable (might need to reboot server/clients)
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 6:46 pm
by CharlesV
As I said.. when I attempted to use wsdd and wsdd2 I spent several months trying to get it all stable. Some times it would see my windows machines, sometimes not. And avahi was nearly as bad, but not quite.
Still even with these, I have not been able to make browsing windows machines work in a stable fashion when we talk about Thunar - Other utilities sure. (like Dolphin - which uses its own discovery ability. Thunar uses cifs and smb, and there are two bugs that are still today wreaking havoc with it.
I finally gave up and went to a custom script
stable until I stopped using them and went to my custom script. I use a combination of nmap, then probe the machines with smb or nmblookup and gather up the machines and put them into a list. I had not completed the UI really, just tossing them into a list, displaying the list and then clicking them.
But I put a decent UI on it yesterday and last night, and have been testing (and documenting it) today. I should have it posted in an hour ish ? This system has been VERY stable for me and works VERY VERY well.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 7:04 pm
by BitterTruth
No doubt, there's always multiple ways of doing something in linux and everyone is comfortable with what suits their own needs.
I have to admit, you have a much bigger setup than me, so I suppose the script makes a lot more sense for you anyway. Personally I can't script, so I tend to spend a bit more time trying to find the laziest solution for my small setups.
It took me a while to sift through all of the historical Samba fluff/baggage, but I think I've got the gist of it. I'll leave a little screenshot from the Samba arch wiki since I think it does a nice job of summarising it up
EDIT:
FullScale4Me wrote: Wed Aug 27, 2025 4:27 pm
What replaced NT1 was SMB2 and later SMB3. Both are faster (compressed data streams), more secure and (by design) more reliable due to using TCP only. Current implementations only use TCP port 445 with a teeny leak of whispers on UDP 137 if nmbd is installed and running. Going 'back' means a lot [more] of things to watch after. MOST of the common exploits that attack a PC with methods that run before the OS loads propagate locally via SMB1, many times bricking a PC firmware. Don't go there unless you can afford the risk!
@FullScale4Me Thank you for this very useful to know. I wasn't sure which ports to allow through UFW as I saw 139 mentioned as well, so allowed all traffic through from certain clients via their ips.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 7:14 pm
by CharlesV
That is to have your linux machine show up for a windows machine - not a problem that I have seen...ever... The issue is browsing the network from a linux machine.. and seeing Windows machines.
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 7:49 pm
by CharlesV
Here is my SMB Network Scanner.
Frustrated by samba browsing not working in any reliable pattern, I decided to write something that got me browsing SMB machines, and in particular Windows machines on a Linux network!
Wanting to have this ability in both my KDE and XFCE machines, I went after a solution that uses 'clean tech' to find machines open to SMB connections... This SMB Network Scanner is the result.
SMB Network Scanner uses nmap to scan the local network, and then presents SMB hosts in a clickable YAD dialog.
The Scanning Dialog looks like this:
With the resulting Clickable list or Network Machines (Linux AND Windows ) listed:

( Yes, the names have been changed to protect the innocent )
Double clicking or highlighting an entry or highlighting and then clicking the connect button, creates the connection in the default file manager, opening that network address.
Dependencies - all can be checked and installed by using the 'install'
parameter when starting the script from the command line.
- nmap
- samba
- yad
- zenity
There are three protocols looked at for every device found, so it takes some time to scan the entire network. So we use a cache file which is instrumental to keep things speedy.
Scanning builds the cache file, which is then used to speed up all future runs. We can rescan, or if the cache file
has been deleted, then we rescan automatically.
I added some command line parameters to get some things done quickly too
- scan - Forces an immediate network scan and then shows the Available machines
- show - Displays the available machines, based on the current cache file
- simple - This was my starting ui, still kind of like it.. so I left it available.
- quick - a Dialog to just show the current network mask and you fill in the last octoid and connect.
- install - Checks and then install the dependencies.
Yes - AI Helped me. I originally had the nmap scan setup and put all machines found into a text file, then worked up the text file to be 'linkable' and I could click on them. This worked great once I figured out to setup a cache file and save the results until I needed to scan again.
Clunky... but affective. Ai helped me put this all into different GUI format, create the 'Scanning' dialog, and smooth out a few issues with default File Managers etc.
The Script and Readme file are attached here, but all you have to do is to save this script, make it executable and then launch it. (I have a custom action in thunar that fires it off. )
Code: Select all
#!/bin/bash
#/*----------------------------------------------------------------------*/
#/*- SMB Network Scanner with YAD GUI
#/*-
#/*- Scans network and presents SMB hosts in a clickable YAD dialog
#/*-
#/*- Double clicking or highlighting an entry and clicking
#/*- the connect button, start the defualt FM, opening
#/*- that network address.
#/*-
#/*- Dependencies:
#/*- - nmap - Provide message if not installed
#/*- - samba - provide message if not installed
#/*- - yad - install it if from the command line
#/*- - zenity - Provide message if not installed
#/*-
#/*- Notes:
#/*- 250826 CV - Version 5 ( see notes )
#/*----------------------------------------------------------------------*/
#/*----------------------------------------------*/
#/*- FUNCTION DEFINITIONS -*/
#/*----------------------------------------------*/
#/*----------------------------------------------*/
#/*- Function to install dependencies
#/*----------------------------------------------*/
install_dependencies() {
#/*- Check if YAD is installed
if ! command -v yad &> /dev/null; then
echo -e "${RED}YAD does not appear to be installed. Installing...${NC}"
sudo apt install yad -y
fi
#/*- Check if zenity is installed
if ! command -v zenity &> /dev/null; then
echo -e "${RED}Zenity does not appear to be installed. Installing...${NC}"
sudo apt install zenity -y
fi
#/*- Check if nmap is installed
if ! command -v nmap &> /dev/null; then
echo -e "${RED}nmap does not appear to be installed. Installing...${NC}"
sudo apt install nmap -y
fi
#/*- Check if samba is installed
if ! command -v smbclient &> /dev/null; then
echo -e "${RED}Samba does not appear to be installed. Installing...${NC}"
sudo apt install samba -y
fi
}
#/*----------------------------------------------*/
#/*- Function to check individual dependency
#/*----------------------------------------------*/
check_dependency() {
local cmd=$1
local name=$2
if ! command -v "$cmd" &> /dev/null; then
msg="$name was not found."
msg+="\nPlease install it or verify it is on your path."
msg+="\n\nOptionally, run this script from a command line with\n"
msg+="the paramater of install to install all of them.\n\nExp: smblist.sh install"
yad --info --text="$msg" --title="SMB Scanner"
exit 1
fi
}
#/*----------------------------------------------*/
#/*- Function to test if SMB is available on a host
#/*----------------------------------------------*/
test_smb() {
local ip=$1
# Try multiple SMB detection methods
# Method 1: Test SMB port 445
if timeout 2 nc -z "$ip" 445 2>/dev/null; then
return 0
fi
# Method 2: Try smbclient with different options
if timeout 3 smbclient -L "//$ip" -N &>/dev/null; then
return 0
fi
# Method 3: Try with SMB2/3 protocol
if timeout 3 smbclient -L "//$ip" -N --option='client min protocol=SMB2' &>/dev/null; then
return 0
fi
# Method 4: Try with guest access
if timeout 3 smbclient -L "//$ip" -U guest%'' &>/dev/null; then
return 0
fi
# Method 5: Check for NetBIOS name (indicates Windows)
if timeout 2 nmblookup -A "$ip" 2>/dev/null | grep -q '<00>'; then
return 0
fi
return 1
}
#/*----------------------------------------------*/
#/*- Function to get hostname and description
#/*----------------------------------------------*/
get_host_info() {
local ip=$1
local hostname="host-$ip"
local description="Unknown Host"
local os_info=""
# Try to get NetBIOS name and info
netbios_info=$(timeout 3 nmblookup -A "$ip" 2>/dev/null)
if [ $? -eq 0 ]; then
# Get computer name
netbios_name=$(echo "$netbios_info" | grep -E '^\s+[A-Z0-9-]+\s+<00>' | head -1 | awk '{print $1}' | tr '[:upper:]' '[:lower:]')
if [ ! -z "$netbios_name" ]; then
hostname="$netbios_name"
fi
# Determine OS type from NetBIOS info
if echo "$netbios_info" | grep -q '<20>'; then
description="Windows Server"
elif echo "$netbios_info" | grep -q '<00>'; then
description="Windows Machine"
fi
fi
# Try SMB OS detection
smb_os=$(timeout 3 smbclient -L "//$ip" -N 2>/dev/null | grep -i "OS=")
if [ ! -z "$smb_os" ]; then
if echo "$smb_os" | grep -qi "windows"; then
description="Windows SMB Share"
fi
fi
# Fallback to DNS lookup for hostname
if [ "$hostname" == "host-$ip" ]; then
dns_name=$(timeout 2 nslookup "$ip" 2>/dev/null | grep -E 'name = ' | cut -d' ' -f3 | sed 's/\.$//')
if [ ! -z "$dns_name" ]; then
hostname="$dns_name"
description="Network Host"
fi
fi
echo "$hostname|$description"
}
#/*----------------------------------------------*/
#/*- Function to scan network
#/*----------------------------------------------*/
scan_network() {
echo -e "${BLUE}Auto-detected network: $NETWORK${NC}"
echo -e "${BLUE}Scanning for SMB shares...${NC}"
# Show progress with zenity if available, otherwise use simple progress
if command -v zenity &> /dev/null; then
{
echo "10" ; echo "# Finding active hosts..."
active_hosts=$(nmap -sn $NETWORK 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(echo $NETWORK | cut -d'/' -f1))
echo "30" ; echo "# Checking SMB connectivity..."
# Clear cache file
> "$CACHE_FILE"
host_count=$(echo "$active_hosts" | wc -w)
current=0
for ip in $active_hosts; do
current=$((current + 1))
progress=$((30 + (current * 60 / host_count)))
echo "$progress" ; echo "# Scanning $ip..."
if test_smb "$ip"; then
host_info=$(get_host_info "$ip")
hostname=$(echo "$host_info" | cut -d'|' -f1)
description=$(echo "$host_info" | cut -d'|' -f2)
echo "$ip|$hostname|$description|smb://$ip" >> "$CACHE_FILE"
fi
done
echo "100" ; echo "# Scan complete!"
} | zenity --width 400 --progress --title="SMB Network Scanner" --text="Scanning..." --auto-close
else
# Fallback to console output
echo -e "${YELLOW}Finding active hosts...${NC}"
active_hosts=$(nmap -sn $NETWORK 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(echo $NETWORK | cut -d'/' -f1))
# Clear cache file
> "$CACHE_FILE"
echo -e "${YELLOW}Checking SMB connectivity...${NC}"
for ip in $active_hosts; do
echo -n "Scanning $ip... "
if test_smb "$ip"; then
host_info=$(get_host_info "$ip")
hostname=$(echo "$host_info" | cut -d'|' -f1)
description=$(echo "$host_info" | cut -d'|' -f2)
echo -e "${GREEN}SMB available - $hostname${NC}"
echo "$ip|$hostname|$description|smb://$ip" >> "$CACHE_FILE"
else
echo -e "${RED}No SMB${NC}"
fi
done
fi
}
#/*----------------------------------------------*/
#/*- Function to show YAD dialog
#/*----------------------------------------------*/
show_dialog() {
if [ ! -f "$CACHE_FILE" ] || [ ! -s "$CACHE_FILE" ]; then
yad --info --text="No SMB hosts found.\nClick 'Scan Network' to search for hosts." --title="SMB Scanner"
return
fi
# Create simple menu from cache file
yad_options=()
while IFS='|' read -r ip hostname description smb_url; do
yad_options+=("$hostname ($ip)" "$smb_url")
done < "$CACHE_FILE"
# Show menu dialog
selection=$(yad --list \
--title="SMB Network Browser" \
--text="Select an SMB host to connect:" \
--column="Host" \
--column="URL:HD" \
--width=500 \
--height=300 \
--button="Scan Network:2" \
--button="Connect:0" \
--button="Cancel:1" \
--hide-column=2 \
--print-column=2 \
"${yad_options[@]}")
ret=$?
case $ret in
0) # Connect
if [ ! -z "$selection" ]; then
smb_url=$(echo "$selection" | tr -d '|')
echo -e "${GREEN}Connecting to: $smb_url${NC}"
#Changed the call from a direct FM to using the xdg-open for default
xdg-open "$smb_url" >/dev/null 2>&1 &
sleep 2
exit 0
fi
;;
2) # Scan Network
scan_network
show_dialog
;;
*) # Cancel/Close
exit 0
;;
esac
}
#/*----------------------------------------------*/
#/*- Function to show alternative ( simple )
#/*- menu function
#/*- May need this to show instead - two strange
#/*- visuals on several test machines
#/*----------------------------------------------*/
show_simple_menu() {
if [ ! -f "$CACHE_FILE" ] || [ ! -s "$CACHE_FILE" ]; then
yad --info --text="No SMB hosts cached.\nRun: $0 scan" --title="SMB Scanner"
return
fi
# Build menu options
menu_text=""
count=1
declare -A urls
while IFS='|' read -r ip hostname description smb_url; do
menu_text+="$count) $hostname ($ip) - $description\n"
urls[$count]="$smb_url"
count=$((count + 1))
done < "$CACHE_FILE"
choice=$(echo -e "$menu_text" | yad --list \
--title="SMB Network Browser" \
--text="Double-click to connect:" \
--column="Available SMB Hosts" \
--width=600 \
--height=300 \
--button="Rescan:2" \
--button="Close:1")
ret=$?
if [ $ret -eq 0 ] && [ ! -z "$choice" ]; then
# Extract number from choice
num=$(echo "$choice" | cut -d')' -f1)
if [ ! -z "${urls[$num]}" ]; then
echo -e "${GREEN}Opening: ${urls[$num]}${NC}"
xdg_open "${urls[$num]}" >/dev/null 2>&1 &
# on KDE we need this to release the connection
sleep 2
exit 0
fi
elif [ $ret -eq 2 ]; then
scan_network
show_simple_menu
fi
}
#/*----------------------------------------------*/
#/*- Function to show quick connect dialog
#/*----------------------------------------------*/
quick_connect() {
ip=$(yad --entry \
--title="Quick SMB Connect" \
--text="Enter IP address:" \
--entry-text="$(echo $NETWORK | cut -d'/' -f1 | sed 's/\.0$/./')")
if [ $? -eq 0 ] && [ ! -z "$ip" ]; then
smb_url="smb://$ip"
echo -e "${GREEN}Connecting to: $smb_url${NC}"
xdg-open "$smb_url" >/dev/null 2>&1 &
sleep 2
exit 0
fi
}
#/*----------------------------------------------*/
#/*- Function to check all dependencies
#/*----------------------------------------------*/
check_all_dependencies() {
#/*- Check if YAD is installed
if ! command -v yad &> /dev/null; then
echo -e "${RED}YAD is not installed. Installing...${NC}"
sudo apt install yad -y
fi
check_dependency "zenity" "zenity"
check_dependency "nmap" "nmap"
check_dependency "smbclient" "Samba"
}
#/*----------------------------------------------*/
#/*----------------------------------------------*/
#/*- Main Script Logic -*/
#/*----------------------------------------------*/
#/*----------------------------------------------*/
#/*- Check if we want to install dependencies first
if [ "$1" = "install" ]; then
install_dependencies
exit 0
fi
#/*- Setup variables and environment
CACHE_DIR="$HOME/.cache/smb_scanner"
CACHE_FILE="$CACHE_DIR/hosts.cache"
mkdir -p "$CACHE_DIR"
#/*- Auto-detect network (or set manually)
AUTO_NETWORK=$(ip route | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+' | head -1 | awk '{print $1}')
if [ ! -z "$AUTO_NETWORK" ]; then
NETWORK="$AUTO_NETWORK"
else
# Fallback: assume /24 from current IP
MY_IP=$(hostname -I | awk '{print $1}')
NETWORK=$(echo "$MY_IP" | sed 's/\.[0-9]*$/.0\/24/')
fi
#/*- setup Output Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
#/*- Check all required dependencies
check_all_dependencies
#/*- Main command line processing and execution
case "$1" in
scan)
scan_network
show_dialog
;;
show)
show_dialog
;;
simple)
show_simple_menu
;;
quick)
quick_connect
;;
install)
install_dependencies
;;
*)
if [ -f "$CACHE_FILE" ] && [ -s "$CACHE_FILE" ]; then
show_dialog
else
echo -e "${YELLOW}No cached results. Scanning network...${NC}"
scan_network
show_dialog
fi
;;
esac
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 8:55 pm
by FullScale4Me
BitterTruth wrote: Wed Aug 27, 2025 7:04 pm
FullScale4Me wrote: Wed Aug 27, 2025 4:27 pm
What replaced NT1 was SMB2 and later SMB3. Both are faster (compressed data streams), more secure and (by design) more reliable due to using TCP only. Current implementations only use TCP port 445 with a teeny leak of whispers on UDP 137 if nmbd is installed and running. Going 'back' means a lot [more] of things to watch after. MOST of the common exploits that attack a PC with methods that run before the OS loads propagate locally via SMB1, many times bricking a PC firmware. Don't go there unless you can afford the risk!
@FullScale4Me Thank you for this very useful to know. I wasn't sure which ports to allow through UFW as I saw 139 mentioned as well, so allowed all traffic through from certain clients via their ips.
The GUFW app has 2 pre-configured Samba 'rules' (identical) that setup a ruleset for SMB1. Use a Simple Rule to set TCP on Port 445 for SMB 2/3 use.
The most ancient of SMB will use all the port range of 135-139 as UDP and some as TCP. Some of that was for WINS <--> Samba traffic IIRC. As time moved SMB to the NT1 'era' a lot of the TCP dropped.
Now just 137 and 138 UDP; 139 and 445 TCP. The 445 TCP was for support of 'NetBios over TCP' when a client supported enabling it (Windows NT - Win 8.1). This allowed older WINS Services on NT 3/4 IIRC to remain in place. These old memories have cobwebs in the cobwebs!
Re: The Samba Wiki entry
Posted: Wed Aug 27, 2025 11:22 pm
by FullScale4Me
CharlesV wrote: Mon Aug 25, 2025 8:33 pm
@FullScale4Me to be honest, I found wsdd flaky as hell and gave up on it. ( It seems to be problem all over.)
I struggled as well with Avahi and finally gave up on it as well.
My Google Fu to the rescue! I found a working WS-Discover daemon that run on *nix!
https://github.com/gershnik/wsdd-native Working on Windows 10 here.
wsdd-native wrote:A Unix daemon that makes your Linux/macOS/BSD/illumos machine visible in Network view of Windows Explorer on newer versions of Windows. It implements WS-Discovery protocol that Windows now uses to discover machines on local network. It is a native daemon, written in C++.
...
There are a couple of similar projects available: wsdd written in Python and wsdd2 written in C. Neither of them, however, fully provides the features above.
Re: The Samba Wiki entry
Posted: Thu Aug 28, 2025 10:55 am
by CharlesV
FullScale4Me wrote: Wed Aug 27, 2025 11:22 pm
CharlesV wrote: Mon Aug 25, 2025 8:33 pm
@FullScale4Me to be honest, I found wsdd flaky as hell and gave up on it. ( It seems to be problem all over.)
I struggled as well with Avahi and finally gave up on it as well.
My Google Fu to the rescue! I found a working WS-Discover daemon that run on *nix!
https://github.com/gershnik/wsdd-native Working on Windows 10 here.
wsdd-native wrote:A Unix daemon that makes your Linux/macOS/BSD/illumos machine visible in Network view of Windows Explorer on newer versions of Windows. It implements WS-Discovery protocol that Windows now uses to discover machines on local network. It is a native daemon, written in C++.
...
There are a couple of similar projects available: wsdd written in Python and wsdd2 written in C. Neither of them, however, fully provides the features above.
Very good!
Re: The Samba Wiki entry
Posted: Fri Aug 29, 2025 2:59 am
by BitterTruth
@CharlesV Fantastic tool! No wonder it works, you're not just scanning for every type of protocol but the OS type, guest access, ports etc too. This could easily be more than just a Samba Network Browser.
Re: The Samba Wiki entry
Posted: Fri Aug 29, 2025 4:37 am
by FullScale4Me
BitterTruth wrote: Fri Aug 29, 2025 2:59 am
@CharlesV Fantastic tool! No wonder it works, you're not just scanning for every type of protocol but the OS type, guest access, ports etc too. This could easily be more than just a Samba Network Browser.
Sounds like something to be careful with on a corporate network. Fine for home
Re: The Samba Wiki entry
Posted: Fri Aug 29, 2025 10:34 am
by CharlesV
BitterTruth wrote: Fri Aug 29, 2025 2:59 am
@CharlesV Fantastic tool! No wonder it works, you're not just scanning for every type of protocol but the OS type, guest access, ports etc too. This could easily be more than just a Samba Network Browser.
Thanks. When I started it I was interested in only smb, but there is so much more info that can be found, I kind of branched out. And this has been working very well for me.
Re: The Samba Wiki entry
Posted: Fri Aug 29, 2025 10:41 am
by CharlesV
FullScale4Me wrote: Fri Aug 29, 2025 4:37 am
BitterTruth wrote: Fri Aug 29, 2025 2:59 am
@CharlesV Fantastic tool! No wonder it works, you're not just scanning for every type of protocol but the OS type, guest access, ports etc too. This could easily be more than just a Samba Network Browser.
Sounds like something to be careful with on a corporate network. Fine for home
Aye, I use a combination of an nmap probe, followed up with smbclient info and netbios info probs, along with an nslookup... all standard stuff on a real network, but yes I can see it being frowned upon by an unknowing admin.
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 4:59 am
by BitterTruth
@CharlesV Ive been playing around with your script for a couple of hours now. In particular, Ive been trying to modify it to allow selecting an network interface.
The reason being that I have 2 VM's setup. A devuan one (smb client) and an alpine (smb server). When I try to run the script on the devuan VM, it defaults to a 10.0.0 network on eth0. This is the one that allows it to use the internet from the host, however the alpine one is on eth1 and 192.168 network.
I was hoping to be able to get it to allow me to pick an interface and then do a scan on that interface, but Ive been struggling.
Iḿ not much of a coder, so taking a leaf out of your book, I tried to get chatgpt to do it for me. Letś just say it was a good exercise in frustration. After almost being gradually driven nuts by it, I thought I´d throw in the towel and ask you to maybe add that feature in.
You might also consider giving your script itś own thread so others can test it out as well.

Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 6:05 am
by Jerry3904
I wonder if Claude wouldn't be a better AI to try. I've seen a number of tests (
this one, for instance) that demonstrated its superiority specifically over ChatGPT for such areas.
<Here endeth my entire brain record about Claude or any other AI>
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 11:23 am
by CharlesV
@BitterTruth Yes, I think putting that script into it's own thread is smart, I was thinking of that too when I posted it.
I had a version earlier on that I chose which network to scan on, but it seemed too clunky as I was 99% of the time looking at my regular network and not my vpn's, and the additional selection box slowed me down. When I have a little more time I will try to integrate that back in.
@Jerry3904 100% agreement. Claude seems to be far better than chatgpt for most things. I found chatgpt to be good helping smooth documents and such, but Claude rocks.
Also.. I should mention that Claude has let me down in many cases where I have tossed code at him, or asked for x, y, z . Some specifics can be done well when either an idea and starting code is handed out... but the best I have found either of them is to hand them something, let them help figure out some smaller part of it, and then integrate that code into what I am working on. So far, almost all "ask chat to build something" in code has failed or the code has been SO BAD that I would never run it.
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 11:27 am
by CharlesV
@BitterTruth And some filtering should be done on the creation of the Network Selector up front.
1) You are never going to want to use your Loopback (lo)
2) You will never want to use a disconnected network interface
3) The selector should show the network notation next to the interface (ie 192.168.1.0/24 )
and in my opinion..
4) The FIRST selection listed should be your primary network route.
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 12:49 pm
by BitterTruth
Check this out guys: not one but 2 scripts generated by claude! and they work!
Python version:
I had to install python3.13-tk (tkinter) - *This was done on Devuan Excalibur (testing)
Gtk3 version
They both work great. The script even calls the default terminal app once I've selected the host/share and logged in. You can see the smb> prompt.
The only niggle I have is that the gtk window is too tall. I had to do a bit of tweaking to get it to show the bottom part. Also when I try to resize it vertically or maximise it nothing happens.
Notice that the loopback address doesn't show up.
I won't upload the scripts unless either of
@CharlesV or
@Jerry3904 say it's ok.
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 1:12 pm
by BitterTruth
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 1:34 pm
by CharlesV
@BitterTruth Very cool. If you want to zip them up and send them to me in a PM I will check them out. Sometimes AI code can be problematic or have serious issues, so I would test them carefully and be very aware that things could go sideways. (i personally would test them in a VM before on my machine rig ;-/ )
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 2:40 pm
by Jerry3904
@BitterTruth I won't upload the scripts unless either of @CharlesV or @Jerry3904 say it's ok.
I don't have any special authority in this case but posting a link to them with cautions, etc. seems OK to me.
I would rather see you do that in
the tip post that @CharlesV just started, since this thread is supposed to be about the poor, suffering Wiki article.
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 4:09 pm
by FullScale4Me
This reminds me of long ago past times being frustrated with Winblows networking. The subtopic was called network interface binding order. Associated to it was the routing table that sent default traffic 0.0.0.0 to the interface listed on top in the binding order. However you change one it must also change the other or the 'got an ip but no internet' will be your bozo prize.
Programs that were not route/multi-interface aware always took the default (top in the binding order applet) network interface. As all good things in Windows get improved, they sometimes get taken away. Early on in Win 10 history this feature was present, then broken a year or two later (you could set it but reboot reverted it) and then gone another year.
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 4:51 pm
by CharlesV
I just got an eye twitch - thanks for that! ;-p
My FAVORITE "problem networking" of all time... Lantastic networks! When they worked - they were amazing. But too many things got in the way of their sharing and while I was able to get most "pretty stable" ... I cannot tell you how frustrating it was to walk away from am install that was working... and the next day it was down.
Re: The Samba Wiki entry
Posted: Sat Aug 30, 2025 11:51 pm
by FullScale4Me
FullScale4Me wrote: Mon Aug 25, 2025 6:22 pm
Top 3 root casual actions/inactions
The highest likely root cause is the UFW aka firewall being enabled by default. Impacts highly both Linux and Windows.
Second, likely is they used they used File Manager (or /etc/samba/smb.conf via internet how-to) and NOT the MX Samba Config app. This also won't lead them to the Wiki, best in MX User Manual.
Thirdly, somewhat related to the above, is not setting a smb user password. If Samba Config refused to make a share until a password is set, this would reduce this a lot IMHO.
Linux
The assumption about Network Browsing Windows hosts in the Linuxes File Manager persists. FWIW, Windows shares haven't appeared in the Network --> Windows in ages. When they do appear (not consistent) it is in the Network (SMB on KDE) folder. The distro whose name sounds like a grandpa's hat removed the Windows folder entirely. Some Linuxes have gelded their File Managers by removing/not including the sharing helper bits (mostly MATE flavors). The helper app WSDD (and its variants) when added to Linuxes returns most to all of the browsing of Linux hosts in Windows.
Windows
On the Windows side, in a distant fourth place is NOT enabling a one click feature ('Network Discovery' and 'File Sharing') to help Samba. The very first time you click on ‘Network’ in ‘Windows File Manager’ you will be prompted to turn on both 'Network Discovery' and 'File Sharing'. Sadly, it is a
one time prompt. If they dismiss it, we hear about it. Enabling it sets up Windows firewall rules, network routing and enables several services to allow other hosts (Windows & Linux) to 'discover' Windows shares/printers. For some reason Linuxes 'seeing' Windows in Network browsing isn't 100% for why I'm not entirely sure. Mostly firewalls IMHO.
WSDD
MX Linux 21 with the addition of WSDD (packaged by Tim) allowed MX 21 hosts to be seen on Windows PCs in Windows Explorer network browsing. Not sure when in 23 it stopped working. I think I/others mentioned it here 1–2 times. Ubuntu has split WSDD into a client and a server function (it can't do both simultaneously) as my guess is to supplant the File Browser share functionality. Client - 'wsdd' and server - 'wsdd-server'. @CharlesV has more 'time in' with configuring wsdd than me.
Above is copied from "Using Samba File Sharing in MX Linux" linked in post 5 of this thread -
viewtopic.php?p=830005#p830005
But wait, there's more! (
Jawtooth,
date unknown)
Less common share setup fail points
Below are some issues brought up on various Linux support forums.
1) Do
NOT modify the file /etc/samba/smb.conf in any way. Use MX Samba Config. [2]
2) Do
NOT use spaces in Samba share file paths or share names. Use – or _ instead.
3) All network devices should be on the same network IP subnet. Local IP addresses should be a 'Bridged' source not NAT.
4) The shared folder should be in the sharing user's users /home folder. [3]
5) If a shared folder is outside /home it MUST be 'owned' by the user and in the sambashare group.
6) Leave the Unix directory permissions alone. The +x IS needed from the root to share folders.
7) The share name can NOT be the same as any user name, group name or the workgroup name.

Workgroup name MUST be 15 characters or less.
9) Share names may not be longer than 12 characters; they may not be accessible on older clients ()95/98/XP).
NOTES
2. Yes, there are a lot of guides saying to do so. MX Linux made the MX Samba Config tool to make it easier.
3. For any user, accessing with the same UserID and (SMB) password.
Edit: expanded on issue #3 above.