Here’s a very simplified smb.conf for Samba which you can try if you are having problems with Samba in your home network. Edit the smb.conf as follows (adjust this to suit your Linux environment and editor):
sudo gedit /etc/samba/smb.conf
Replace the contents of that file with the code below.
Note: there are two shared items at the bottom that you will want to omit or change to your use. The first (storage) is a shared hard drive. The second is a shared folder (/home/user/Videos). Modify these to suit your needs.
[global] workgroup = home server string = %h server (Samba, Ubuntu) dns proxy = no local master = yes log file = /var/log/samba/log.%m map to guest = bad user max log size = 1000 name resolve order = bcast host lmhosts wins obey pam restrictions = yes os level = 33 pam password change = yes panic action = /usr/share/samba/panic-action %d passdb backend = tdbsam passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . security = share syslog = 0 unix password sync = yes usershare allow guests = yes usershare max shares = 100 usershare owner only = False cups options = raw printing = cups printcap name = cups printcap cache time = 750 use client driver = yes ;guest ok = no ;guest account = nobody [printers] comment = All Printers browseable = no path = /var/spool/samba printable = yes ;guest ok = no ;read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers ;browseable = yes ;read only = yes ;guest ok = no [storage] comment = storage path = /media/storage writeable = yes browseable = yes force user = frank force group = frank read only = no guest ok = yes create mask = 0777 directory mask = 0777 [Videos] path = /home/frank/Videos writeable = yes browseable = yes guest ok = yes force user = frank force group = frank
In my home system, I have a second Hard Drive on each of my computers for common storage of projects and files.
I’d like to have this second drive accessible from all the other computers, with all permissions. It’s just a private home network, so I’m not worried about controlling who does what. I want it to be wide open.
Here’s what I do to set it up:
sudo fdisk -l
We’ll assume for the rest of the examples that the drive is /dev/sda2
sudo mkdir /media/storage
sudo gedit /etc/fstab
For an EXT4 formatted drive:
/dev/sda2 /media/storage ext4 rw,user,exec,noatime 0 0
For an NTFS formatted drive:
/dev/sda2 /media/storage ntfs users,defaults 0 0
These next three instructions only apply to EXT formatted drives. If your drive is NTFS format, you can skip them.
sudo chmod +w /media/storage
sudo chmod 777 /media/storage
sudo chmod -R 777 /media/storage/*
sudo chgrp -R users /media/storage
sudo gedit /etc/samba/smb.conf
Put in the following lines (substitute your user/group name, and your path):
[storage] path = /media/storage writeable = yes browseable = yes force user = frank force group = frank read only = no guest ok = yes create mask = 0777 directory mask = 0777