Can't set up samba share

Hello. I want to set up samba share on my manjaro computer to be accessible on windows computers. I configured smb.conf like that:

[global]
   workgroup = WORKGROUP
   dns proxy = no
   log file = /var/log/samba/%m.log
   max log size = 1000
   client min protocol = SMB2
   server role = auto
   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 allow guests = yes
   name resolve order = lmhosts bcast host wins
   security = user
   guest account = nobody
   usershare path = /var/lib/samba/usershare
   usershare max shares = 10
   usershare owner only = no
   force create mode = 0070
   force directory mode = 0070
   load printers = yes
   printing = bsd
   printcap name = /dev/null
   disable spoolss = yes
   show add printer wizard = yes
   local master = yes
   preferred master = yes
   interfaces = 192.168.1.8/24

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

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

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

[myfiles]
    comment = KubekSzklany
    path = /home/kubekszklany/Shared
    public = yes
    only guest = no
    writable = yes

And after that i run these commands:
systemctl enable smb
systemctl start smb
systemctl enable nmb
systemctl start nmb
But i still can’t connect from windows to my linux share, and when i click “network” tab in windows explorer is shows me my routers, tv’s and other devices, but not my linux computer.

A few things i spotted in the documentation that might be relevant.

It’s been a while since I’ve set up samba but I did get it to work, way back. I don’t have Windows.

Looking at some notes, the first suggestion I’d have in any case is to check if the samba daemon is running. It looks like you tried to start it with ‘smb’ and ‘nmb’ - you could try running the command:
systemctl status smb

However, it looks like on my Ubuntu machine (on which I’m running a samba server at the moment) the service is called ‘smbd’/‘nmdb’ not ‘smb’/‘nmb’ - my notes say that other distros use smb.service, so you could try both, or look up which it is (I think it’s the latter on Manjaro?)

You also didn’t mention actually installing the samba packages - I believe they are called samba and smbclient - I can’t remember whether these are pre-installed in Manjaro, so you might want to check.

If the service is up and running, you could try to see if another linux machine sees it OK and that might help rule out if it is an issue specifically with Windows. I know Windows has some kind of workgroup setting (it’s in the ‘global’ section at the top) - you may need to check these match?

Looking at my samba share info, I spot that I have the following lines, which your ‘myfiles’ doesn’t:
browseable=yes
create mask = 0777
directory mask = 0777

I also have a valid users variable line (valid users = foo) which sets this to the username I use, foo.

I do remember that I needed to set up the ownership and permissions of the folder I had decided to share.

If you aren’t logging on as a guest, you would need to set up a samba user/password with the smbpasswd command.

oh, and the systemctls, etc., may need sudo…

I installed wsdd2 package and now it appears in network tab in windows explorer, but i still can’t connect to it. I also changed a my config, so it nows look that:

[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
   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 allow guests = yes
   name resolve order = lmhosts bcast host wins
   security = user
   guest account = KubekSzklany
   usershare path = /var/lib/samba/usershare
   usershare max shares = 10
   usershare owner only = no
   force create mode = 0070
   force directory mode = 0070
   load printers = yes
   printing = bsd
   printcap name = /dev/null
   disable spoolss = yes
   show add printer wizard = yes
   local master = yes
   preferred master = yes
   interfaces = 192.168.1.8/24

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

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

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

[public_files]
    comment = PublicFiles
    path = /home/kubekszklany/public
    browsable = yes
    guest ok = yes
    writable = yes
    guest account = KubekSzklany
    create mask = 0775
    directory mask = 0755

When i type “smbclient -N \localhost\public_files” from my linux computer it connects without any problems, but when i try to connect from windows machine it shows me “Windows cannot access \KUBEKSZKLANY\public_files”.

Still not working…

Also, i don’t know if this help, but when i try to create share from gui i have “The premissions for [directory-name-here] prevent other users from accessing this share” and if i press “create share” anyway it shows me “net usershae returned error 255”. Directory permissions are set to 777. When i type “net usershare add” in terminal it create share without problem (but still i can access it only from loaclhost). I don’t have any firewall. And it also works from other linux clients, but can’t connect from any windows client.

To start I would remove the interfaces = 192.168.1.8/24 or change it to interfaces = 192.168.1.0/24 Also make sure your a member of the group sambashare .You can also add yourself to samba with smbpasswd -a yourusername .

Still not working…

But it is weird for me, that i can connect from any linux pc, but can’t connect from any windows pc, so there will be problem with some windows-specific settings i think.

Something like this?
https://wiki.archlinux.org/title/Samba#Windows_10_1709_and_up_connectivity_problems_-_"Windows_cannot_access"_0x80004005

1 Like

Ok, it works now, thank you :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.