"Samba doesn't work." Rant

Using avahi on my home network, I share the user’s (me) /home/(name here) on each of the 3 machines…Once set up, I don’t have to enter a password.

From Nemo, using F3 to open another Nemo pane, I can use this pane to open another machine’s folder and drag and drop…

The version of avahi is the same on all machines, btw.
My 2 cents :wink:

1 Like

Read up on using Symbolic Links".

I will check out avahi – thanks for your help.

Neville, I really appreciate all your insight and suggestions on this issue – thank you.

@kgwoo
Perhaps you could give us all a brief description of what avahi does and how to set it up – or point us to a good tutorial
I know you gave an account in your previous email. It needs to be a bit lower level for beginners.
Neville

I have used them within one filesystem, I will check it out as you suggest; thanks.

I’ll work up an organized install brief, and post it soon :+1:

1 Like

You might want to take a look at ‘Syncthing’ to see if that would do what you want. Essentially it keeps any directories (w/ subdirs) you have set up in continuously synced between all the machines it is configured on… It is peer to peer, not client/server so if you have multiple machines it does a web and keeps all the connected machines in sync no matter which ones are down at any given time. Any machines that aren’t connected get brought back in sync as soon as they come back into the network.

They have versions for all the major O/S’ and Android, not sure about IOS. It is a bit of a pain to set up, but once running it’s totally transparent.

However they do caution you that it is NOT suitable for use as a backup, because it keeps everything synced - nuke a file / directory, etc. on one machine, and the others will nuke it as well, no recovery beyond what can be done on a non-synced machine… (presumably ransomware would hit all synced directories the same in worst case…) So you still need a backup system.

It does all it’s stuff between machines w/ serious heavy duty encryption, so no worries about security other than whatever you do on each individual machine.

I use it to keep my main desktops in two different locations and a laptop (all on Debian) for travel synced, so I have the same files available to me regardless of which machine I’m on.

ART

1 Like

I’ve found with just about all “modern” debian based distros - avahi (aka Bonjour, or Zeroconf, and sometimes mDNS) works “out of the box” i.e. it’s installed by default - at least on Ubuntu 18.04 and onwards, Debian Buster 10 onwards…

I’ve NEVER had to install any avahi packages … I have however had hairpulling moments when Red Hat / RPM based distros will NOT play ball with Avahi / Zeroconf / Bonjour.

I build a Ubuntu 20.04 desktop call machine10, and then from elsewhere on my LAN (wired or wifi) I can just ping or ssh to machine10.local… It all just works… it’s plug and play pretty much…

And it pretty much works on my Macbook Pro too… it’s called “methone” and I can ping or ssh methone.local from anything else on my LAN (e.g. from a Pi4 running Buster, a Pi3 running stretch, ryzen desktop running Ubuntu 20.04).

Couple of systems where it doesn’t work? OrangePi running Armbian (Ubuntu 16.04), my FreeNAS (FreeBSD 11.3) - however - I can ping that OrangePi - so it’s publishing stuff about itself , it’s called orenmwy :

╭─x@methone.local ~
╰─➤  neofetch
                    'c.          x@methone.local
                 ,xNMM.          ---------------
               .OMMMMo           OS: macOS 11.6.1 20G224 arm64
               OMMM0,            Host: MacBookPro17,1
     .;loddo:' loolloddol;.      Kernel: 20.6.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 60 days, 1 hour, 5 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 1 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1920x1080, 1920x1080
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: iTerm2
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   Terminal Font: NotoMonoForPowerline 16
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Apple M1
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Apple M1
       .cooc,.    .,coo:.        Memory: 1602MiB / 8192MiB




╭─x@methone.local ~
╰─➤  ssh orenmwy.local
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
  ___  ____  _         ____  _____
 / _ \|  _ \(_)  _    |___ \| ____|
| | | | |_) | |_| |_    __) |  _|
| |_| |  __/| |_   _|  / __/| |___
 \___/|_|   |_| |_|   |_____|_____|

Welcome to Ubuntu Xenial with Armbian Linux 3.4.113-sun8i
System load:   0.06 0.07 0.06  	Up time:       64 days
Memory usage:  13 % of 2014MB 	Zram usage:    8 % of 1007Mb 	IP:            10.1.1.126
CPU temp:      58°C
Usage of /:    33% of 15G

[ General system configuration (beta): armbian-config ]

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Last login: Mon Feb 21 16:56:48 2022 from fe80::10dd:2e00:2a1:b7b%eth0
╭─x@orenmwy ~
╰─➤  ping methone.local
ping: unknown host methone.local

But I don’t care - I don’t need it to resolve names via Avahi, and I’m not going to waste effort figuring out how or why, AFAIK “if it aint broke, don’t fix it…” :smiley:

FYI - I just tried to setup local file sharing (I assume it defaults, to SMB), and then it prompts me “Sharing service is not installed”, with choices of Close, or “Install service” and when I choose “Install service” it barfs with “Sharing service installation failed”, and Close or Retry. Retry never works. So whatever it is it’s broken, and I’ve tried this on two different Ubuntu 20.04 machines - same result… I probably won’t troubleshoot this any further because I don’t need Samba, and would always eschew SMB in favour of native “UNIX” file sharing via NFS.

But it is a tad annoying that something so simple, that seems to advertise itself as simple, won’t work, and is anything but simple!

1 Like

Thank you, I might try that .
My situation is similar to yours

I use it to keep my main desktops in two different locations and a laptop (all on Debian) for travel synced, so I have the same files available to me regardless of which machine I’m on.

except I dont travel
Regards
Neville

I love that. It happens to me every day.

I looked on MX which is supposed to be Debianplus…

 dpkg -l | grep avahi
ii  avahi-daemon                                  0.8-5                                  amd64        Avahi mDNS/DNS-SD daemon
ii  libavahi-client3:amd64                        0.8-5                                  amd64        Avahi client library
ii  libavahi-common-data:amd64                    0.8-5                                  amd64        Avahi common data files
ii  libavahi-common3:amd64                        0.8-5                                  amd64        Avahi common library
ii  libavahi-core7:amd64                          0.8-5                                  amd64        Avahi's embeddable mDNS/DNS-SD library
ii  libavahi-glib1:amd64                          0.8-5                                  amd64        Avahi GLib integration library

The daemon is there but not all your list?
I went into Dolphin and it has Shared Folders (SMB) (folder link to smb:/) but it finds nothing if I click on it

I assume I have to turn on some other computer and share something? Dont know how to do that. Lets wait for @kgwoo

Cheers
Neville

I’ve never had any issues using Samba on any of my hosts and accessing shares over the common network.

First thing to do after creating the share is to create the sambashare password for the user.

sudo smbpasswd -a {username}

on each of the hosts in the network.

Then I modify the smb.conf file in the /etc/samba directory and change the workgroup name to match the network name in the [global] section if you have modified that.

Then in the same [global] section right after the workgroup name I add
server min protocol = NT1

Save the file and either reboot or restart the service
sudo systemctl smbd restart

Then when you access the network share through Nautilus, you get the popup access window to choose accessing the share either one-time for the session or permanently.

Input the samba share username and password and !voila!

Keith – THANK YOU!
Setting up a Samba password for myself on my computer where the shared folder is, has made it so that when I access the folder from the other machine, I can open the file right there from that folder; it recognizes me as “owner”. I haven’t even done the other steps you recommended, but I will try them too. I you have a friend who is one of the Nautilus developers :slight_smile: maybe you could suggest to them that Nautilus should refer users to this kind of information. How about a menu item: “Help with Connecting” ? For example, I’ve used shared folders in Linux (or tried to) for a long time, but didn’t know that there was such a thing as a “Samba password”. Nautilus doesn’t make it clear that you are using Samba. Perhaps it works the same way with Nemo et al. When Nautilus asks for a password, it does not say “SAMBA password” so I assumed it was the COMPUTER user password they wanted.

Happy to help out. The protocol setting helps out with the newer versions of OpenSSL and Windows clients. NT1 just sets a base level for all hosts on the network to have a common ground.

With just Linux clients, often not necessary as you found out.

Only familiar with Ubuntu so far but believe the procedure works with most Debian based distros.

I’m a little surprised no one has mentioned sshfs. It is an extremely quick and easy way to mount a remote directory on your local machine. https://github.com/libfuse/sshfs

It would seem that there are some issues with sshfs and it is not under active development so bugs are not being addressed

That is unfortunate. It is a good concept.

Yes, avahi is usually already installed, at least the avahi-daemon.

Avahi Installation On Linux

“Avahi is a fully LGPL framework for Multicast DNS Service Discovery.
It allows programs to publish and discover services and hosts
running on a local network with no specific configuration. For
example you can plug into a network and instantly find printers to
print to, files to look at and people to talk to.”

First, if you don’t have recent backups, create them now. You will be doing this install on all the machines that will make up your network.

When the backup is done, run this command:
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan

The above installs the base avahi-daemon, and a few other helpful additions.

[1] Make sure avahi-daemon is running on both machines:
sudo service avahi-daemon start

[2] Make sure port 5353 is open: avahi expects it to be open. If you are not sure just disable the firewall if you are using one:
sudo ufw disable

[3] Create an avahi samba service file:

sudo nano /etc/avahi/services/samba.service

[4] Then copy and paste the following into that file:

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
   <name replace-wildcards="yes">%h SMB</name> ## Display Name
   <service>
       <type>_smb._tcp</type>
       <port>445</port>
   </service>
</service-group>

Please note: The very first line cannot have any leading spaces in front of it or else it won’t work.

[5] You don’t need to do this but just in case restart avahi:
sudo service avahi-daemon restart

When you use Nemo on either machine and select “Network” you should see the other machine as “hostname SMB”

Also: You are using an avahi samba.service file. Samba does the equivalent by itself without requiring that file since Mint 19. You can keep the samba.service file if you want ( since it allows you to change the display name ) but if you do I would suggest disabling the way samba does it by adding the following line in /etc/samba/smb.conf in the [global] section:

multicast DNS register = no

Then restart samba.

Samba done the Linux way. No more workgroups. No more netbios names. No more name resolve orders. No more nmbd or any other Windows specific services required.

Use the editor of your choice, but take note of getting the samba service file correct!

Now, go to the file manager (Nemo, in my case) and share the folders in question. As mentioned above, I simply share the whole /home/(user) folder.

When you first access one of these newly shared folders, the password window will popup, but just hit the “connect” button.

1 Like

@kgwoo,
Thank you. That is the level of understanding I was looking for
Regards
Neville

I am a relative newby as far as understanding all the jargon of Linux terminal uses etc, (I do copy and paste terminal lines from the net when doing some things like installs etc.), but I have been using Ubuntu/Mint for about 7 years now and I love it. Currently using Mint 20.3
When I want to copy files from one computer to another (I have 3, plus a tablet and a cell phone), I simply copy my files from the first computer to my Pcloud folder and then access the Pcloud folder from the second computer and download or copy and paste the files.
Dead simple!
My Pcloud folder is always on my desktop and my panel for all my computers and on my Android cellphone and tablet, so all my files are accessible from anywhere in the world.
I have over 500GB of storage space that I paid for all at once (while they had a sale on) and it’s for life.
I am thinking of upgrading to 2 terabytes when the next sale happens.
This is way better then a NAS.
Since I also use Bitwarden password manager I don’t have to worry about security either.
So this way you have a choice of either transferring the files via Pcloud or just leaving them there as a backup and accessing them from whichever computer you happen to be using at the time.
As you add more music files (or whatever), to the computer you are using at the time, just save-as the file to Pcloud again over top of the existing file and voila, it’s all backed up and usable/accessible to all your machines.
No programming necessary!
If you are paranoid about using the cloud for a backup (like my wife is), you can always download the Pcloud files to a large hard drive periodically so you have them secure in your possession if that makes you sleep better.
It’s a no brainer.
This way there is no need to sync files because every time you save/save-as a file it is for all intents and purposes “synced” since there is only the one file anyway (in Pcloud, so no matter where you access it from the next time it’s already up to date.

1 Like