Artbox: Setting Up a Samba Share

Disclaimer: Proximity Corporation provided the information in this article and it was deemed accurate as of 30 May 2007. Apple Inc. is not responsible for the article's content. This article is provided as is and may or may not be updated in the future.

This setup configuration allows for open sharing, where everyone has read, write, and delete permission.

[global]
  workgroup = proximity 
  server string = Samba Server
  guest account = guest
  log file = /var/log/samba/%m.log
  max log size = 0

By default this is set to 'user' in RH8. It has to be changed to 'share' to work as a fully open share.

  security = share
  encrypt passwords = yes
  smb passwd file = /etc/samba/smbpasswd
  unix password sync = Yes
  passwd program = /usr/bin/passwd %u
  passwd chat = *New*password* %n\\n *Retype*new*password* %n
  		\\n *passwd:*all*authentication*tokens*updated*successfully*
  pam password change = yes
  obey pam restrictions = yes
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

  dns proxy = no 

Normally the [homes] section is enabled but it's recommended to disable it. A directory that is being shared as part of [homes] such as /home/publisher is treated differently then other directories, even if it is shared under another name.

[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775

If you want users samba doesn't recognize to be mapped to a guest user map to guest = bad user.

This is an example of how to share the CD-ROM of the machine running Samba to everyone. If you want to make a writable share, just change the path to something that can actually be written to and then change writable to yes.

[cdrom]
  comment = CD-ROM Drive
  path = /mnt/cdrom
  browseable = yes
  writable = no
  guest ok = yes
  public = yes

Make sure that the path that you are sharing exists. So for example if your path line read as "path = /foobar" you would go to the command line and do "mkdir /foobar". And after use "chmod 777 /foobar" on the directory you want shared.

Published Date: Feb 20, 2012