Skip to content
Tags

Samba v3.2.15 (2/4) – smb.conf for “security=SHARE”

12. December 2011

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



Advertisements

From → Filesharing

One Comment

Trackbacks & Pingbacks

  1. Samba 1/2 – Install Samba via macports « Scratch Pad

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: