To get started with creating a public share that can be fully accessed by everyone, continue with the steps below:
sudo apt-get update
sudo apt install samba
The commands above install Samba and all other dependencies.
sudo mkdir /home/Public
Then set the share permission so everyone has full access to it.
sudo chmod 0777 /home/Public
sudo chown -R nobody:nogroup /home/Public
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Next, run the commands below to open/create a new configuration file.
sudo nano /etc/samba/smb.conf
Then add the content below into the file and save. Our share will be called Public as defined in the setting below [Public]
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no
bind interfaces only = yes
# add to the end
[Public]
path = /home/Public
writable = yes
guest ok = yes
guest only = yes
read only = no
create mode = 0777
directory mode = 0777
force user = nobody
Save the file and exit.
sudo systemctl restart smbd