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
Set a username and password:
sudo smbpasswd -a <user_name>
Figure out what directory you wish to share.
Copy the samba configuration to make a backup
sudo cp /etc/samba/smb.conf ~
and edit the config file to fit your needs
sudo vim /etc/samba/smb.confI 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 = 755guest 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 up with
smbpasswdand not the UNIX accounts.
sudo systemctl restart smbd
you can use
testparm to check for syntax errors.