I hate this.

Setting up a public share

Source: Samba - ArchWiki

In /etc/samba/smb.conf

security = user
map to guest = bad user
guest account = guest # The account that access will be mapped to

[guest] # The name of the share
    comment = guest
    path = /tmp/ # Path which is mapped to the share
    public = yes
    only guest = yes
    writable = yes
    printable = no
    force user = guest # IMPORTANT. Not mentioned in Arch Wiki.

The share will always be access with the user specified in guest account, so this account must have permissions for the path.

You must set force user if you want accesses to happen as the specified user. Otherwise they run as some (?) other account, which might not have write (or even read) permission to the directory where the share is located.

Make it show up in “Network” on windows

Newer versions of windows took out support for NetBIOS, which was previously used to discover shares on the network. The newer alternative, WSD, has not been implemented by Samba, however, there is a script implementing it here: GitHub - christgau/wsdd: A Web Service Discovery host daemon.

It is a single .py file, which can just be placed in the path. (thank god, cause it’s not in the repos)

See also