Samba public share

How to configure a Debian based Linux distribution to share a folder with anyone on the network, with read and write access ?

Create the public directory

mkdir /media/public && chmod 777 /media/public

Edit the samba file configuration

vi /etc/samba/smb.conf

Add the code below at the end

[public]
comment = Public Folder
path = /media/public
guest ok = yes
public = yes
writable = yes
printable = no
create mask = 777

Restart samba

sudo service smbd restart