Enabling Samba on FreeBSD

The following steps can be used to enable Samba on FreeBSD.

Notes: Related Urls:
Steps for Samba version 3.0.3:
  1. Install Samba from /usr/ports/net/samba-devel:

    # cd /usr/ports/net/samba-devel
    # make install
  2. Enable Samba:

    # echo 'samba_enable="YES"' >> /etc/rc.conf.local
  3. Customize /usr/local/etc/smb.conf:

  4. Valiate smb.conf:

    # /usr/local/bin/testparm -s
  5. Save the default smbpasswd and secrets.tdb:

    # cd /usr/local/private 
    # mv secrets.tdb secrets.tdb.default
    # mv smbpasswd smbpasswd.default
    This may be required only when upgrading from older versions of samba.
  6. Set the samba password for users who need samba access:

    # /usr/local/bin/pdbedit -a username
  7. Start Samba:

    # /usr/local/etc/rc.d/samba.sh start
  8. (Optional) Check to see if samba is running:

    $ ps -auwxx | egrep '[sn]mbd'
    root    909  0.0  0.8  6504 4008  ??  Is   11:29PM   0:00.00 /usr/local/sbin/smbd -D
    root    911  0.0  0.4  3488 2048  ??  Ss   11:29PM   0:00.00 /usr/local/sbin/nmbd -D
  9. (Optional) Test samba using smbclient:

    $ /usr/local/bin/smbclient -U username \\\\localhost\\username
    or
    $ /usr/local/bin/smbclient -U username //localhost/username

Steps for Samba version 3.0.0:
  1. Install Samba from /usr/ports:

    # cd cd /usr/ports/net/samba-devel
    # make install
  2. Enable Samba:

    # cd /usr/local/etc/rc.d
    # ln -s samba.sh.sample samba.sh
  3. Customize /usr/local/etc/smb.conf:

  4. Create the samba log file directory:

    # mkdir -p /var/log/samba
  5. Set the samba password for users who need samba access:

    # /usr/local/bin/pdbedit -a username
  6. Start Samba:

    # /usr/local/etc/rc.d/samba.sh start
  7. (Optional) Check to see if samba is running:

    $ ps -auwxx | egrep '[sn]mbd'
    root    909  0.0  0.8  6504 4008  ??  Is   11:29PM   0:00.00 /usr/local/sbin/smbd -D
    root    911  0.0  0.4  3488 2048  ??  Ss   11:29PM   0:00.00 /usr/local/sbin/nmbd -D
  8. (Optional) Test samba using smbclient:

    $ /usr/local/bin/smbclient \\\\localhost\\username
    or
    $ /usr/local/bin/smbclient //localhost/username

Valid HTML 3.2

$Id: freebsd_samba.html 1023 2008-11-28 07:31:02Z ranga $