Daniel's ramblings
Setting samba shares
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
-
Install samba:
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. Mine was
/media/media5/
-
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.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 up with
smbpasswd
and not the UNIX accounts. -
restart samba
sudo systemctl restart smbd
you can use testparm
to check for syntax errors.