Using SAMBA with FreeBSD 4.10 and Windows XP

It took me several days, but I finally cracked the code and figured out how to share the home directories on one of my FreeBSD 4.10 boxes using Samba.

To keep an incredibly long story short, I'm going to post the contents of my smb.conf file with a few notes.

Here's the setup:

Samba fileserver: Pentium 3 running FreeBSD 4.10 p5

Windows Client: Pentium 4 running Windows XP Professional SP2 (firewall disabled)

Here's my smb.conf:

[global]
        workgroup = MSHOME
        server string = %h_Samba Server
        encrypt passwords = Yes
        update encrypted = Yes
        nt acl support = no
        remote announce = 192.168.1.255/MSHOME
        security = user
        add user script =/usr/sbin/pw useradd -d /dev/null -g machines -s /bin/false -n %u

[homes]
        comment = Home Directories
        browseable = no
        writeable = yes

Notes:

1. There must be identical user accounts on both the Samba fileserver and the Windows client.
2. The user names and passwords of these accounts must be identical.
3. The magic line, the one that finally got it working, is the last line in the [global] section:

              add user script =/usr/sbin/pw useradd -d /dev/null -g machines -s /bin/false -n %u

I'm not sure how it works, but it does and that was the key - this line allowed me to access the home directory of my user account on the samba file server. Many thanks to Randy who posted it as a response to this article from the excellent FreeBSD Diary

Links to some useful information I used during this process:

Back to JACoulter.net