smb.conf (macports)
/opt/local/etc/samba3/smb.conf
Example
[global]
workgroup = WORKGROUP
server string = Samba OS X Lion
security = share
# ---------------------------------------------------------
# Create all files and folders as this user/group
# ---------------------------------------------------------
# Hint:
# This only works for users without root privileges!
# ---------------------------------------------------------
force user = foo
force group = staff
# ---------------------------------------------------------
# Misc
# ---------------------------------------------------------
dns proxy = no
load printers = no
[shared]
comment = shared
path = /data/shared
public = yes
only guest = yes
writable = yes
printable = no
More examples: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/FastStart.html#anon-rw
Result
- The new share is now available in the finder.
- There is no need to log in as a special user, the guest user will be used instead.
Troubleshooting
Hint #1
Make sure, the user “foo” has no root privileges on your lion server.
Why? Samba will not allow access for root users.
force user = foo
force group = staff
Hint #2
Simple starting & stopping of smbd and nmbd while tailoring your smb.conf
See man smbd and man nmbd for details.
$ sudo /opt/local/sbin/nmbd -i -debuglevel=2
$ sudo /opt/local/sbin/smbd -F -S --debuglevel=2
Hint #3
Do not start smbd as root in interactive mode. It will not work. See hint #1.
$ sudo /opt/local/sbin/smbd -i
Hint #4
Add/enable/no pw for forced user with smbpasswd? Not sure about that one…
$ sudo smbpasswd –a foo
$ sudo smbpasswd –e foo
$ sudo smbpasswd –n foo
See man smbpasswd for details