Introduction

Configure FreeBSD unix as an SMB file server allows it's resources to be accessed by machines running the Microsoft File Sharing Client over a TCP/IP network. Offering SMB file serving requires the installing and configuring of a third party software package called Samba.

Read the Software Installation Overview and Samba installation and Configuration to prepare for this lab. For more information about samba try this web site.

Lecture Outline

Often organizations will use a unix server to provide file and printer services to other hosts of various operating systems across their networks. To allow hosts running the Microsoft File and Printer Sharing Client we must implement the SMB (Server Message Block) protocols and we can do this over TCP/IP with Samba. We saw with the SMB client we could load a kernel module on demand by using mount_smbfs command. On the server side we will need a third party software package called Samba which enables us to interface with clients in a Microsoft environments. Samba is a collection of software components that allows a unix server to act as a File or Print server, but also as a WINS server, or a Windows NT style Domain Controller. Samba can also act as an Active Directory client, allowing unix machines to be members servers of a domain or to authenticate their local users against the domain user database. As with most software packages in FreeBSD, Samba can be found in the ports collection, and is also available as a precompiled package which is gow we will install it for our lab.

On the FreeBSD server

The inetd daemon or "Internet Super Server" is so called because it manages connections for several different network services. We will be using this to enable SWAT (a web interface) for managing samba. See configuring SWAT later in this lab.

As we have seen with adding other services, we can use the sysinstall utility to enable new services or we can edit the /etc/rc.conf file with the appropriate entries.

On the XP Host

Enabling Home Directory Access

Testing unix samba server

It is very useful to be able to test out your configurations from the unix samba server before going to the client machine:
To list shares that are available from the configured Samba server, execute the following command:
smbclient –N -L yourhostname (-N will not prompt you for a password)
To connect to the shares that you have configured you can use a unix client:
smbclient //hostname/your-service
smbd –v will show status of the smbd daemon
testparm /usr/local/etc/smb.conf
is very useful especially if you configure samba directly by modifying smb.conf instead of using SWAT
smbpasswd –a username (rather than changing the password through the SWAT menu, you can modify passwords from the shell prompt

Last updated: 2010 February
Updated by: Cheri Weaver

Written by: Cheri Weaver