Originally posted by Colby
Shares generally go at the bottom of your smb.conf. You want to answer a few questions before you open up any shares: 1. Who should be able to access them and from where? 2. Do they need to be readable only or read-write? 3. Do you need to execute any scripts on the system before someone can access them (example: mount a cdrom)?
After you figure that stuff out, you can set up the shares
If you want to user-protect a directory, you need to make sure your smb.conf global section has "security = user". If you only want to share files, you can use "security = share". You will need to make sure the users exist on your system if you choose security = user, and also make sure that they have an entry in smbpasswd.
Sections in the smb.conf begin with [name], where name is the name of the share (except in the case of global, where it is the global configuration). "homes" is a special name, in that samba treats this to mean the user's home directory.
There are a ton of options for shares, for more info you can see the Samba manual or man smb.conf. I will give some example shares here.
# remember that what is in here is the name of the share
# I only want these hosts to be able to connect.
hosts allow = 192.168.100.0/24
# This is what appears in the comment field when someone connects
# or when they view your list of shares.
comment = Mp3 folder
# I don't want someone to dump, just to read.
writable = no
# Don't do any file locking on this directory.
locking = no
# This is the directory on my system that I want to share.
path = /usr/local/share/mp3
# Let everyone who can see my computer know that I have this share.
public = yes
External link to this information