Cant share a folder

hey
i never use forum’s help but now im desperate i’ve spent few days on this :frowning:
i had debian and everything worked fine
i had my shared folder on separate disk and after i installed manjaro i made all the same config but nothing works
what i have:
fresh manjaro(recently installed and updated)
smb 4.16.0

samba config
[global]
log file = /var/log/samba/%m.log
max log size = 1000
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = NewUNIXpassword %n\n ReTypenewUNIXpassword* %n\n *
passwd:allauthenticationtokensupdatedsuccessfully
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 = /run/media/jan/ae2beb57-2907-4c68-a84e-e9d5ce24ab9b/Share
usershare max shares = 100
usershare owner only = no
force create mode = 0770
force directory mode = 0770

[Share]
comment = Public Folder
path = /run/media/jan/ae2beb57-2907-4c68-a84e-e9d5ce24ab9b/Share
public = yes
writable = yes
read only = no
guest ok = yes
create mask = 0777
directory mask = 0777
force create mode = 0777
force directory mode = 0777

Do i need to change any HDD config? (eg. permissions since root is the owner)
I did a lot of changes on samba config, but nothing works. Looks like the problem is on top layer.
Samba is up and running, i do restart service every time I make any change on config
shared folder is 777 permissions
Ive tryed to make folder in home directory, no changes

testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

Global parameters

[global]
log file = /var/log/samba/%m.log
map to guest = Bad Password
max log size = 1000
name resolve order = lmhosts bcast host wins
obey pam restrictions = Yes
pam password change = Yes
passwd chat = NewUNIXpassword %n\n ReTypenewUNIXpassword* %n\n passwd:allauthenticationtokensupdatedsuccessfully*
passwd program = /usr/bin/passwd %u
security = USER
unix password sync = Yes
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = No
usershare path = /run/media/jan/ae2beb57-2907-4c68-a84e-e9d5ce24ab9b/Share
idmap config * : backend = tdb
force create mode = 0770
force directory mode = 0770

[Share]
comment = Public Folder
create mask = 0777
directory mask = 0777
force create mode = 0777
force directory mode = 0777
guest ok = Yes
path = /run/media/jan/ae2beb57-2907-4c68-a84e-e9d5ce24ab9b/Share
read only = No

That won’t work because the path doesn’t exist until you mount it.

You need to mount it ot a permanent location e.g. /data/smb/share - then create a bind mount from /data/smb/share to /srv/smb/share and add /srv/smb/share to your smb.conf.

Also set your smb version as high as possible

[global]
   min protocol = SMB2
   max protocol = SMB3

Doing it as described achives two goals

  1. Secure you server’s filesystem from accidental file system access outside the share
  2. Secure the share against from being discovered by ransomware using netbios to locate windows shares.

thank you vm
that worked for me

for those who is new to linux
it took me only few steps:

  1. bind source folder to (eg.) /mnt/shared folder name
  2. mount /mnt/shared folder name
  3. add shared folder path to smb.conf

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