Samba shares have always been a little confusing. Their authentication system doesn't use the UNIX accounts. This is a short guide for Ubuntu 16.04
sudo apt update sudo apt install samba
sudo smbpasswd -a <user_name>
sudo cp /etc/samba/smb.conf ~
and edit the config file to fit your needs
sudo vim /etc/samba/smb.conf
I wanted to make the share read only and write for my user. This is the settings I used.
[share] path = /media/media5 browseable = yes guest ok = yes read only = yes write list = daniel bob steve create mask = 755
guest ok allows anonymous users.
read only will make everyone have read only permissions.
write list makes the users listed to be able to write too. However these users are those you set
smbpasswd and not the UNIX accounts.
sudo systemctl restart smbd
you can use
testparm to check for syntax errors.