Setting up Samba

General Information

Just how do you get your Windows machines to access your FreeBSD server and printers? The trick is with Samba. Here I’m going to show you how to setup Samba so your server will appear in ‘My Network Places’ and configured for user account access.


  1. Local root access on the box or be able to su to root.
  2. A SSH client that supports ANSI colors such as puTTy or SecureCRT (if you are setting it up remotely).
  3. Your favorite text editor (we will use nano).
  4. Your favorite web browser (we will use lynx).


# cd /usr/ports/net/samba
# make install clean

You will be prompted with a configuration menu to choose additional options to be installed. For this guide we won’t choose any.


Now that Samba is installed, we need to configure it for your network before we fire it up.

Section A — inetd

# nano /etc/inetd.conf

Look for and uncomment the following:

swat    stream  tcp     nowait/400      root    /usr/local/sbin/swat    swat

Save the changes and restart inetd

# killall -HUP inetd

Section B — Samba

Bring up SWAT (Samba Web Administration Tool)

# lynx http://localhost:901

  1. log in with root
  2. Navigate to ‘Globals
  3. Change netbios name to whatever you want your server to come up as in ‘My Network Places’
  4. Choose ‘yes‘ to encrypt passwords
  5. Select ‘Commit Changes‘ to save
  6. Navigate to ‘Shares
  7. Next to ‘Create Share‘ type in your share name (I used ‘Share’) and then select ‘Create Share
  8. Type in the complete path for the directory you want to share
  9. Choose ‘no‘ for read only if you want your users to be able to write
  10. Choose ‘yes‘ for guest ok to allow for anonymous access to the shared directory
  11. Select ‘Commit Changes‘ to save
  12. Navigate to ‘Password Management
  13. Type in a valid user account that already exists in /etc/passwd
  14. Type in the password twice and select ‘Add User
  15. Navigate to ‘Status
  16. Start both smbd and nmbd
Note: Any time you make a future change to the configuration, you need to restart both services.

You now can test this by logging in through ‘My Network Places.’

Speak Your Mind