Can't connect to samba after update; Service is running (2022-08-13++)

I don’t know what to sadvise - Linux is not Windows

Linux requires a thought through setup when it comes to sharing - and quite frankly there is a huge diffference between being a server or a client - samba wise.

Cytat

You cannot use LInux as you use Windows because Linux is a born networked system - Windows network sharing has always been an afterthought.

I remember Window 3.11 - workgroups edition - the worst network client ever invented.

I created peer-to-peer shareing using Novell networking client using token ring networking back in late 80’ies

Cytat
You write generics, we know it, linux is not windows.

The problem is that a clean fresh install of the system and updating samba to 4.16.4-3 works fine. And when there is some time the system on the disk and you are doing the update, samba crashes. Have you seen a system that does this?
changing permissions, writing, reading resources does not change anything after such a strange update.

And here everything has fallen apart, so we are looking for a solution. The np file of my samba configuration is the same as it was. Resource permissions have always been and I have been fine. After the last update, the only resource I can share is the home / public directory.

[global]
   workgroup = WORKGROUP
   dns proxy = no
   log file = /var/log/samba/%m.log
   max log size = 1000
   client min protocol = SMB2
   server role = standalone server
   disable netbios = no
   dns proxy = no
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
   pam password change = yes
   map to guest = Bad Password
   usershare owner only = false
   usershare allow guests = yes
   name resolve order = lmhosts bcast host wins
   security = user
   guest account = nobody
   usershare path = /var/lib/samba/usershare
   usershare max shares = 100
   usershare owner only = yes
   force create mode = 0070
   force directory mode = 0070
   load printers = no
   printing = bsd
   printcap name = /dev/null
   disable spoolss = yes
   show add printer wizard = no

[homes]
   comment = Home Directories
   browseable = no
   read only = yes
   create mask = 0700
   directory mask = 0700
   valid users = %S

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

[mp3]
   comment =  mp3
   path = /media/work/mp3/
   public = yes
   writable = yes
   browsable = yes
   read only = no
   available = yes
   guest ok = yes
   create mask = 0777
   directory mask = 0777

[filmy]
   comment =  filmy
   path = /media/work/Filmy/
   public = yes
   writable = yes
   browsable = yes
   read only = no
   available = yes
   guest ok = yes
   create mask = 0777
   directory mask = 0777

[yarass]
   comment =  yarass
   path = /home/yarass/
   public = yes  
   writable = yes
   browsable = yes
   read only = no
   available = yes
   guest ok = yes
   create mask = 0777
   directory mask = 0777

This configuration on a fresh install + update works fine.

On old installation + update only works

[yarass]
   comment =  yarass
   path = /home/yarass/
   public = yes  
   writable = yes
   browsable = yes
   read only = no
   available = yes
   guest ok = yes
   create mask = 0777
   directory mask = 0777

you are so completely messing system permissions

what do you think you are doing?

making everything inside your home world read/write?

No matter what you tell samba to do here your effecitive filesystem permission prevents it.

Samba will never exceed actual filesytem permissions - no matter what you tell it to do.

This is what it is supposed to be, this is my internal home network, it is used by 2 users and they are both supposed to have access to this place.
I might as well provide a public directory.

  path = /user/public
   public = yes  
   writable = yes
   browsable = yes
   read only = no
   available = yes
   guest ok = yes
   create mask = 0777
   directory mask = 0777

The majority of issues regarding samba is the ignorance surrounding windows file sharing - which is not samba. Samba is an implementation using the Windows filesharing protocols and thus needs to be setup correctly. It is not like Windows → rightclick → share → done

Even if the file manager pretents to be able to do it - a lot of setup is assumed for this to work.

Then what are your effective filesystem permissions on the folder?
And did you create a priviliged group?
And did you assign the relevant users as members of group?

Yea I’m now having the same problem.
The latest version of SAMBA will NOT allow shares the 2nd disk on my system mounted at /mnt/blah. This HAS been working fine for the last 2+ year though…

1 Like

Possible dupilcate:

I am facing the same problem.

I configured my system from the arch wiki instructions Samba - ArchWiki

My config

[global]
        workgroup = Beast
        server role = standalone server
        server string = %h server (Samba %v)
        invalid users = root
        security = user
        usershare path = /var/lib/samba/usershares
        usershare max shares = 100
        usershare allow guests = yes
        usershare owner only = yes
[homes]
        comment = Home Directories
        browseable = no
        valid users = %S
        writable = yes

Samba status

❯ systemctl status smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Tue 2022-08-16 06:40:27 AEST; 22min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 1326 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 4 (limit: 38407)
     Memory: 31.3M
        CPU: 193ms
     CGroup: /system.slice/smb.service
             ├─1326 /usr/bin/smbd --foreground --no-process-group
             ├─1333 /usr/bin/smbd --foreground --no-process-group
             ├─1334 /usr/bin/smbd --foreground --no-process-group
             └─9352 /usr/bin/smbd --foreground --no-process-group

Aug 16 06:40:27 Manjaro systemd[1]: Starting Samba SMB Daemon...
Aug 16 06:40:27 Manjaro smbd[1326]: [2022/08/16 06:40:27.380204,  0] ../../source3/smbd/server.c:1741(main)
Aug 16 06:40:27 Manjaro smbd[1326]:   smbd version 4.16.4 started.
Aug 16 06:40:27 Manjaro smbd[1326]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Aug 16 06:40:27 Manjaro systemd[1]: Started Samba SMB Daemon.

Adding a share with samba user does not work

net usershare add share_name_here /mnt/Data/share_folder "Comment" "my_host\samba_user:f"
net usershare add: cannot convert name "my_host\samba_user" to a SID. The transport connection is now disconnected..

It works if I use the user’s SID but I still cannot access the share.

I configured mine using the following Manjaro Wiki article:

hi, I tried your way, I created my own predictable structure data/…bla**, stock, with changed permission, ownership, and all possible combos, but it does not work.

Hello, Manjaro Users

I still have a problem with Samba on Manjaro 21.3.7 (2022-08-16)

Can someone confirm that Samba issues are still present and not being fixed in this version?

Thank you
Apidech T.

Facing that issue too, thanks for a topic.

1 Like

Still a problem, I even reverted to 4.16.2-1 of smb and smbclient but same problem. It must be related to something else in the recent update.

I can see shares using net usershare list

But cannot access or see it using smbclient -L or a Windows network map from explorer.

Here are some results from investigations:

❯ cat /etc/samba/smb.conf
[global]
        workgroup = MyWorkgroup
        server role = standalone server
        server string = %h server (Samba %v)
        invalid users = root
        security = user
        usershare path = /var/lib/samba/usershares
        usershare max shares = 100
        usershare allow guests = yes
        usershare owner only = yes

[homes]
        comment = Home Directories
        browseable = no
        valid users = %S
        writable = yes

❯ net usershare list
Min
❯ smbclient -L 192.168.1.100 -U smb_user
Password for [.....]:

        Sharename       Type      Comment
        ---------       ----      -------
SMB1 disabled -- no workgroup available

❯ systemctl status smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Wed 2022-08-17 06:53:17 AEST; 2h 2min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 1353 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 3 (limit: 38407)
     Memory: 30.5M
        CPU: 567ms
     CGroup: /system.slice/smb.service
             ├─1353 /usr/bin/smbd --foreground --no-process-group
             ├─1360 /usr/bin/smbd --foreground --no-process-group
             └─1361 /usr/bin/smbd --foreground --no-process-group

Aug 17 06:53:17 Manjaro systemd[1]: Starting Samba SMB Daemon...
Aug 17 06:53:17 Manjaro smbd[1353]: [2022/08/17 06:53:17.519333,  0] ../../source3/smbd/server.c:1741(main)
Aug 17 06:53:17 Manjaro smbd[1353]:   smbd version 4.16.4 started.
Aug 17 06:53:17 Manjaro smbd[1353]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Aug 17 06:53:17 Manjaro systemd[1]: Started Samba SMB Daemon.
❯ journalctl -S "6 hour ago" -xu smb.service
Aug 17 06:53:17 Manjaro systemd[1]: Starting Samba SMB Daemon...
░░ Subject: A start job for unit smb.service has begun execution
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit smb.service has begun execution.
░░ 
░░ The job identifier is 97.
Aug 17 06:53:17 Manjaro smbd[1353]: [2022/08/17 06:53:17.519333,  0] ../../source3/smbd/server.c:1741(main)
Aug 17 06:53:17 Manjaro smbd[1353]:   smbd version 4.16.4 started.
Aug 17 06:53:17 Manjaro smbd[1353]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Aug 17 06:53:17 Manjaro systemd[1]: Started Samba SMB Daemon.
░░ Subject: A start job for unit smb.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░ 
░░ A start job for unit smb.service has finished successfully.
░░ 
░░ The job identifier is 97.                                                                                               ✔ 


1 Like

For me, this was an AppArmor issue. My shares are located outside of my home directory and i had to whitelist them in /etc/apparmor.d/local/usr.sbin.smbd.

https://wiki.archlinux.org/title/samba#Permission_issues_on_AppArmor

8 Likes

Thanks ! That made the trick for me!

This fixes the problem for me too.

Hooray, hooray - thanks to TheInvi(n)sible!

:clap:

I wish there were more Invisible like you making a difference!!!
:metal: :partying_face: :metal:

Hi my share are also located outside of home directory how can I whitelist it
let’s say this is my location

/mnt/befadfl-asdklf-wuqio-0e1/cupcakes/pineapple

I’ve opened nano to edit it I just don’t know what word to enter

Have a look at the example in the linked Arch wiki. Replace /data with your path. Save it and then restart AppArmor service or reboot your System.

1 Like
/etc/apparmor.d/local/usr.sbin.smbd
"/data/" rk,
"/data/**" lrwk,

hey thanks but what’s rk, lrwk written in arch wiki , do I have to add it too if so which one rk or lrwk or both

Upgrade without samba and smbclient.

Same issue after doing a full upgrade.

About 5 times, I restored and confirmed using snapshot.

I’ll leave it alone for the time being.

My personal opinion and expectation is that editing a working smb.conf is just a waste of time.

Kernel: 5.18.14-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
Desktop: Cinnamon v: 5.4.9 Distro: Manjaro Linux base: Arch Linux