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.
Requirements
- Local root access on the box or be able to su to root.
- A SSH client that supports ANSI colors such as puTTy or SecureCRT (if you are setting it up remotely).
- Your favorite text editor (we will use nano).
- Your favorite web browser (we will use lynx).
Installation
# 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.
Configuration
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
- log in with root
- Navigate to ‘Globals‘
- Change netbios name to whatever you want your server to come up as in ‘My Network Places’
- Choose ‘yes‘ to encrypt passwords
- Select ‘Commit Changes‘ to save
- Navigate to ‘Shares‘
- Next to ‘Create Share‘ type in your share name (I used ‘Share’) and then select ‘Create Share‘
- Type in the complete path for the directory you want to share
- Choose ‘no‘ for read only if you want your users to be able to write
- Choose ‘yes‘ for guest ok to allow for anonymous access to the shared directory
- Select ‘Commit Changes‘ to save
- Navigate to ‘Password Management‘
- Type in a valid user account that already exists in /etc/passwd
- Type in the password twice and select ‘Add User‘
- Navigate to ‘Status‘
- Start both smbd and nmbd
You now can test this by logging in through ‘My Network Places.’