If any of you have your Mac sitting on a network with other PC users, you may know how frustrating it can be to share files through Samba. While the /etc/smb.conf file that Apple provides is useful, setting-up an effective public share requires some tweaking. I could not find the necessary tutorial on how to solve my problems on this site or elsewhere, so I decided to write this hint once I figured out how to get things working they way I wanted them to.
This hint has been tested with OS X 10.4.2 only, so I don't know if this will work or is helpful on other systems, though I imagine it is. It would be worth knowing if the backup config file, /etc/smb.conf.template, is significantly different for different versions of OS X.
Looking at /etc/smb.conf, the configuration file for Samba, you will notice among others, [global] settings and a [home] share, which usually do not require changing. There is also a [public] share commented-out with semicolons. If you remove the comment notation (and have Windows sharing turned on in the Sharing System Preferences, of course), then you will be able to connect to the specified directory with a blank user name and password.
To do this, edit the file as root (sudo pico /etc/smb.conf) and remove the comments from the following lines:
;[public]
; path = /tmp
; public = yes
; only guest = yes
; writable = yes
; printable = no
On my computer, I changed the listed path from /tmp to the public folder in my main account. To test your share locally, type Command-K in the Finder and connect to smb://localhost/public. When you are asked to authenticate, leave both the user name and guest name blank. Hit enter and voila! Hopefully you will see whatever directory you chose to share as a mounted network connection on your desktop.
valid users = @unknown, @guest
guest ok = yes
The @ symbol forces Samba to look in NIS and Unix user directories, as opposed to the default location. Excluding this symbol keeps the user names from authenticating properly.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20051006095436254