Warum ist Samba nicht von Ubuntu nach Manjaro übertragbar

Warum ist Samba nicht von Ubuntu nach Manjaro übertragbar?

Nachdem ich es nicht geschafft habe, Samba unter Manjaro zu etablieren, habe ich es unter Ubuntu (v22) getan. Als Input habe ich das folgende Tutorial aus der Manjaro Wiki gewählt.
Basic Samba Setup and Troubleshooting

Im Abschnitt “Basic Server configuration” steht eine sehr einfache smb.conf Datei; die habe ich - mit etwas anderem Pfad in dem Beispiel Share - eingetippt.
Ich habe also unter Ubuntu (1) Samba installiert, (2) meine userid mit smbpasswd -a hinzugefügt, (3) die genannte kleine smb.conf Datei eingetippt, andere Pfade festgelegt; damit funktioniert samba unter Ubuntu:

# 2022-12-05 24:00
[global]
   workgroup = arminux
   server string = arminux Samba Server
   server role = standalone server
   log file = /var/log/samba/log.%m
   max log size = 50
   guest account = nobody
   map to guest = Bad Password
   
   min protocol = SMB2
   max protocol = SMB3

[Ubu-ad@achat]
   path = /home/AD@achat
   writable = yes
   printable = no

[Ubu-bifitamu]
   path = /media/jjubu22/P9-100G-bifitamu
# dieser Pfad ist Ubuntu spezifisch, muss unter Manjaro angepasst werden
   writable = yes
   printable = no

Dann bin ich im Ubuntu Dateimanager (Caja) auf “Netzwerk” gegangen, habe dort meinen PC-Namen gesehen, angeklickt - und habe meine Sharenamen gesehen.Ich habe mich unter Ubuntu unter meiner (Ubuntu) userid bei meinem Share eingeloggt und konnte auf die Dateien meines Shares zugreifen.

Dann habe ich auf meinem alten PC Manjaro gebootet, pcmanfm gestartet und konnte auch dort auf die shares zugreifen.
###################################################################

In Manjaro habe ich ebenfalls Samba installiert, meine userid mit smbpasswd hinzugefügt, die smb.conf Datei von ubuntu übertragen, den Pfadnamen meines Shares angepasst.
Es läuft nicht!

Das kann ich aus 2 Gründen nicht verstehen:
(1) ich habe es ja gemäß einem Tutorial aus der Manjaro Wiki getan.
(2) ich hätte erwartet, dass Samba bzw die Konfigurration mit smb.conf von jedem Linux auf beliebiges anderes Linux portierbar ist.

Hat jemand eine Idee?

https://wiki.archlinux.org/title/Samba

samba ist ein systemd service

u.U. mußt Du den erst starten bzw dafür sorgen, daß er automatisch gestartet wird

Samba - ArchWiki

sudo smbd start; nmbd start

nicht wahr? hab ich getan.

nein, nmb ist nicht erforderlich. bitte lese die beschreibung aus dem verlinkten arch-wiki. das wird hoffentlich ein paar unklarheiten aufklären.

the usual way to do it (it’s a systemd service …):

systemctl status smb.service
systemctl enable --now smb.service

I also know the systemctl commands. However, they always yield an error and then stop. For my standalone service the “smbd start” should be enough.

They should not just stop - and one should investigate the reason an error is thrown.

perhaps - if it works, it works, right?

Es startet jedenfalls den systemd Service nicht …

Sorry, ich bin wieder mal ins englische abgeglitten und hab es nicht gemerkt.

Hallo jolexin,

wie immer wäre doch die exakte Fehlermeldung interessant.

viele Grüsse gosia

Übersetzt mit https://lingva.ml

Nein - Sie können Samba nicht auf die gleiche Weise wie Ubuntu starten.

@Nachlese hat dir erklärt, wie es auf Manjaro geht.

Nein - Sie können Samba nicht auf die gleiche Weise wie Ubuntu starten.

Nachlese hat dir erklärt, wie es auf Manjaro geht.

Denken Sie auch daran

  • Ein Systembenutzer ist kein Samba-Benutzer
  • Ein Samba-Benutzer benötigt einen Systembenutzer

Damit Sie also auf Samba-Freigaben auf Manjaro zugreifen können, müssen Sie auf Manjaro einen Systembenutzer mit demselben Namen erstellen – und diesen mit Samba mit smbpasswd verknüpfen.

Nach dem Boot von Manjaro sehe ich folgende Services:

 systemctl status smb.service
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Sun 2022-12-11 18:45:46 CET; 14s ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 1149 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 3 (limit: 18839)
     Memory: 9.7M
        CPU: 43ms
     CGroup: /system.slice/smb.service
             ├─1149 /usr/bin/smbd --foreground --no-process-group
             ├─1151 /usr/bin/smbd --foreground --no-process-group
             └─1152 /usr/bin/smbd --foreground --no-process-group

Dez 11 18:45:46 achat systemd[1]: Starting Samba SMB Daemon...
Dez 11 18:45:46 achat smbd[1149]: [2022/12/11 18:45:46.400498,  0] ../../source3/smbd/server.c:1741>
Dez 11 18:45:46 achat smbd[1149]:   smbd version 4.17.3 started.
Dez 11 18:45:46 achat smbd[1149]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Dez 11 18:45:46 achat systemd[1]: Started Samba SMB Daemon.

[jaro@achat ~]$ systemctl status nmb.service
● nmb.service - Samba NMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; preset: disabled)
     Active: active (running) since Sun 2022-12-11 18:45:46 CET; 1min 9s ago
       Docs: man:nmbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 1147 (nmbd)
     Status: "nmbd: ready to serve connections..."
      Tasks: 1 (limit: 18839)
     Memory: 8.6M
        CPU: 72ms
     CGroup: /system.slice/nmb.service
             └─1147 /usr/bin/nmbd --foreground --no-process-group

Dez 11 18:45:46 achat nmbd[1147]: [2022/12/11 18:45:46.362024,  0] ../../source3/nmbd/nmbd.c:901(ma>
Dez 11 18:45:46 achat nmbd[1147]:   nmbd version 4.17.3 started.
Dez 11 18:45:46 achat nmbd[1147]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Dez 11 18:45:46 achat systemd[1]: Started Samba NMB Daemon.
Dez 11 18:46:09 achat nmbd[1147]: [2022/12/11 18:46:09.402561,  0] ../../source3/nmbd/nmbd_become_l>
Dez 11 18:46:09 achat nmbd[1147]:   *****
Dez 11 18:46:09 achat nmbd[1147]: 
Dez 11 18:46:09 achat nmbd[1147]:   Samba name server ACHAT is now a local master browser for workg>
Dez 11 18:46:09 achat nmbd[1147]: 
Dez 11 18:46:09 achat nmbd[1147]:   *****

Ich starte Thunar; sehe jedoch kein Netzwerksymbol zum Anklicken:

Also starte ich pcmanfm und sehe das Netzwerksymbol:

Ich klicke ACHAT (das ist mein PC) und sehe ein Fenster mit der Fehlermeldung:

Empfangen der Freigabenliste vom Server ist gescheitert: Das Programm verursachte den Abbruch der Verbindung

(Vergleich mit Ubuntu: Dort erhalte ich beim Klick auf ACHAT eine Aufforderung zur Anmeldung.)

Ich klicke die Meldung mit OK weg und sehe eine 2. Fehlermeldung:

Der angegebene Ort ist nicht eingehängt

Danach bleibt das Fenster leer und weiß.

# # #

Die jüngsten Zeilen von log.%m zeigen einen Error Code 22 - was immer das bedeutet:

[2022/12/11 18:45:46.360351,  0] ../../source4/samba/server.c:621(binary_smbd_main)
  samba version 4.17.3 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2022
[2022/12/11 18:45:46.360550,  0] ../../lib/util/become_daemon.c:150(daemon_status)
  daemon_status: daemon 'samba' : Starting process...
[2022/12/11 18:45:46.389201,  0] ../../source4/samba/server.c:851(binary_smbd_main)
  At this time the 'samba' binary should only be used for either:
  'server role = active directory domain controller' or to access the ntvfs file server with 'server services = +smb' or the rpc proxy with 'dcerpc endpoint servers = remote'
  You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
[2022/12/11 18:45:46.389274,  0] ../../lib/util/become_daemon.c:119(exit_daemon)
  exit_daemon: daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22

testparm hat an meiner smb.conf Datei nichts auszusetzen; deshalb ist der Text “misconfigured server role” unverständlich.

Mein Eindruck ist, dass ein Berechtigunsproblem vorliegt, doch ich kann auch beim Lesen des Arch Wikis nichts Genaueres herausfinden.

Serverrolle ala AD-Server? Warum dann standalone-server?
Wenn ein AD Service + Samba eingerichtet werden soll, wird noch einiges mehr erforderlich.

Server Rollen die es gibt:

SERVER ROLE = AUTO
SERVER ROLE = STANDALONE
SERVER ROLE = MEMBER SERVER
SERVER ROLE = CLASSIC PRIMARY DOMAIN CONTROLLER
SERVER ROLE = CLASSIC BACKUP DOMAIN CONTROLLER
SERVER ROLE = ACTIVE DIRECTORY DOMAIN CONTROLLER
SERVER ROLE = IPA DOMAIN CONTROLLER

Sollen nur User Ordner frei gegeben werden?

Auch deine Protokolle…

sehen nicht “Arch Linux” like aus… woher stammen deine Daten? Ubuntu?

man samba sagt

clients =

client max protocol (G)
The value of the parameter (a string) is the highest protocol level that will be supported by the client.

Possible values are :
•CORE: Earliest version. No concept of user names.
•COREPLUS: Slight improvements on CORE for efficiency.
•LANMAN1: First modern version of the protocol. Long filename support.
•LANMAN2: Updates to Lanman1 protocol.
•NT1: Current up to date version of the protocol. Used by Windows NT. Known as CIFS.
•SMB2: Re-implementation of the SMB protocol. Used by Windows Vista and later versions of Windows. SMB2 has sub protocols available.
•SMB2_02: The earliest SMB2 version.
•SMB2_10: Windows 7 SMB2 version.
By default SMB2 selects the SMB2_10 variant.
•SMB3: The same as SMB2. Used by Windows 8. SMB3 has sub protocols available.
•SMB3_00: Windows 8 SMB3 version.
•SMB3_02: Windows 8.1 SMB3 version.
•SMB3_11: Windows 10 SMB3 version.
By default SMB3 selects the SMB3_11 variant.
Normally this option should not be set as the automatic negotiation phase in the SMB protocol takes care of choosing the appropriate protocol.

The value default refers to SMB3_11.

IPC$ connections for DCERPC e.g. in winbindd, are handled by the client ipc max protocol option.

Default: client max protocol = default

Example: client max protocol = LANMAN1
client min protocol (G)
This setting controls the minimum protocol version that the client will attempt to use.

Normally this option should not be set as the automatic negotiation phase in the SMB protocol takes care of choosing the appropriate protocol unless you connect to a legacy SMB1-only server.

See Related command: client max protocol for a full list of available protocols.

IPC$ connections for DCERPC e.g. in winbindd, are handled by the client ipc min protocol option.

Note that most command line tools support --option='client min protocol=NT1', so it may not be required to enable SMB1 protocols globally in smb.conf.

Default: client min protocol = SMB2_02

Example: client min protocol = NT1

lange reder … kurzer Sinn…

ich würde gar keine maxProtocole angeben…(so sehen meine aus…)

client min protocol = CORE
server min protocol = CORE

Do not use protocol lower than SMB2 - they are insecure.

Samba does not allow browsing network unless you are a logged in user.

That means you cannot click the server name to get a list of valid shares.

You must be logged in or indicate that you are a valid user - in which case you will be prompted for password.

In Thunar - address bar (Ctrl+L) then enter a valid path smb://username@server/sharename

Another option is to use gvfs and setup a user service to mount your device on login

Verwenden Sie kein niedrigeres Protokoll als SMB2 – sie sind unsicher.

Samba erlaubt kein Durchsuchen des Netzwerks, es sei denn, Sie sind ein angemeldeter Benutzer.

Das bedeutet, dass Sie nicht auf den Servernamen klicken können, um eine Liste gültiger Freigaben zu erhalten.

Sie müssen eingeloggt sein oder angeben, dass Sie ein gültiger Benutzer sind – in diesem Fall werden Sie nach einem Passwort gefragt.

In Thunar - Adressleiste (Strg+L) dann einen gültigen Pfad eingeben smb://username@server/sharename

Eine andere Möglichkeit besteht darin, gvfs zu verwenden und einen Benutzerdienst einzurichten, um Ihr Gerät bei der Anmeldung zu mounten

Install GVFS

sudo pacman -Syu gvfs gfvs-smb gvfs-nfs gvfs-mtp gvfs-afc

to @linux-aarhus linux-aarhus:
Indeed, on entering in Thunar (or pcmanfm)

smb://server/sharename or
smb://user@server/sharename

I obtain a login request and after login I can access the files and folders of my share.

In other words, my smb.conf is ok and gives me the option to access my files and folders from another Linux PC in my house.

Next I tried the connectivity to Win10. None!

  • \\achat is not acceptable;
  • smb://… is not acceptable.

Next I tried the Gnome virtual file system proposal.
Reboot.
No change in behaviour, i.e. my shares remain unaccessible from Win10.

I re-iterate, with Ubuntu - with the same smb.conf file - running on my PC (instead of Manjaro) the shares on my PC are immediately visible on another Linux PC and also on a Win10 PC .

I am very happy with Manjaro, however, do not understand why things need to be so overly complicated in Manjaro that neither my supporters, who are experienced in Manjaro, nor I can find an answer to my question.

The reason might indeed be this:

Ubuntu might have configured that for you - Manjaro and Arch almost certainly not.

But I do not know and will not/cannot test - I have no Windows drives or samba shares.

Manjaro is not Ubuntu and the difference between Manjaro and Ubuntu is huge.

You can get the same functionality from Manjaro but you need to configure this.

If I understand correct

You can connect using

  • Linux Client
  • Manjaro Samba Service

You cannot connect using

  • Windows client
  • Manjaro Samba service

I have added the following to Samba Basic Setup and Troubleshotting guide.

Filemanagers

Some file managers implement a GoNetwork option.

Screenshot using PCManFM

image

To make this option usable you need the avahi package synced and services enabled and running. Network Manager depends on Avahi so on Manjaro it is installed but not enabled.

Enable using command (provide password when challenged) or use sudo

systemctl enable avahi-daemon.service avahi-daemon.socket avahi-dnsconfd.

I am available for hire as consultant :slight_smile: if you need it

I have no idea what your issue is - because setting up a basic samba service is as simple as it gets.

Of course you need to know how but that is available as well.

I booted a Raspberry Pi using a default Manjaro ARM minimal image - and starting here Install Samba Package

Basic Samba demo installation

Basic installation and configuration

Install samba package

Install the samba package and ensure your system is fully updated in the process.

sudo pacman -Syu samba

Basic Server configuration

Create the configuration file /etc/samba/smb.conf - the folder may need to be created beforehand.

sudo mkdir -p /etc/samba
sudo touch /etc/samba/smb.conf

Edit the file - using superuser privilige - insert below content and save the file (need superuser). If you are connecting an existing network of servers change the WORKGROUP to match the existing network.

[global]
   workgroup = MANJARO
   server string = Manjaro Samba Server
   server role = standalone server
   log file = /var/log/samba/log.%m
   max log size = 50
   guest account = nobody
   map to guest = Bad Password
   
   min protocol = SMB2
   # max protocol = SMB3

[public]
   path = /srv/samba/rpi-share
   public = yes
   writable = yes
   printable = no

Test your config

sudo testparm /etc/samba/smb.conf

Started the service

sudo systemctl enable --now smb

Then I created the shared folder

sudo mkdir -p /srv/samba/rpi-share

I usually don’t images but in this showcase I think they prove my point.

Then I opened my Windows tablet (Windows 11 Pro) - I didn’t enable nmb daemon as I wanted to show off.

Image

Entering the locating of the service - in this case just an ip - you will need to replace with the ip for your system - and I get the list of shares

\\ip.x.y.z
Image

I can open the file I created

Image

The properties of the share tels us it is indeed the MANJARO workgroup

Image

If I try to change the file and save it - I get permission error - and this is to be expected - because even though I have defined the share as writable - the underlying folder has only read permissions.

Back to server side - I can make the file writable

sudo chmod go+w /srv/samba/rpi-share/rpi-share.txt

Then I can edit the file and save the changes

Image

If I try to create a new file in the share - I get permission error once more - again this is expected as the folder is readonly.

Image

Back to server side - I can make the folder writable

sudo chmod go+w /srv/samba/rpi-share

And then I can create a new file

Image

Conclusion

The share I showed off here has become a dangerous share as it has been changed to world writable - just the kind of share ransomware loves.

It is fine for demonstration purpose so a big warning is

NEVER USE SUCH KIND OF SHARE IN PRODUCTION

Settting up a samba server on Manjaro can be straight forward and without issues.