Running Samba on the Mac OS X Server
Pages: 1, 2
Activating Password Server
Now that you've set up file and printer shares, you need to make sure users can properly authenticate to access them. In Mac OS X Server, this is accomplished with the Open Directory Password Server, a service based on the Simple Authentication and Security Layer (SASL) standard and usable with many different authentication protocols, including the LAN Manager and Windows NT LAN Manager (NTLM) protocols. This section describes how to support SMB client authentication, but for more information on what Password Server does and how it works, see the Mac OS X Server Administrator's Guide.
|
Password Server Password Server is a feature introduced with Mac OS X Server 10.2. In prior versions of Mac OS X Server, Windows authentication was handled with Authentication Manager, which stored a user's Windows password in the If you need to use Authentication Manager, use the following procedure to enable it:
|
To enable Password Server or merely check its settings, start the Open Directory Assistant. Unless you wish to change any of the settings, just click the right arrow button in the lower-right corner of the window until you get to the first Security step. At this point, activate Password Server by selecting the option marked Password and authentication information will be provided to other systems. The next step displays the main administrative account, and the one after that gives you a choice of authentication protocols to enable (see Figure F-4). Make sure that SMB-NT is checked, and check SMB-Lan Manager if you have Windows 95/98/Me or older clients. The final step saves the Password Server configuration and prompts you to reboot.
Figure F-4. Password Server authentication protocols

Enabling Password Server
To enable the use of Password Server for a user account, launch Workgroup Manager, and click the Accounts button in the toolbar. Under the Users tab on the far left (with the silhouette of a single person), select the account, and under the Advanced tab on the right, select Password Server for the User Password Type (see Figure F-5). You are prompted to enter a new user password to be stored in the Password Server database. After saving the account configuration, the user can authenticate and access shares from an SMB client.
Figure F-5. Workgroup Manager: Enabling Password Server authentication

Monitoring Services
Once you've got everything working, you'll want to keep an eye on things. The Server Status application gives you views into the various services provided by Mac OS X Server. For Windows Services, you can see the current state of the service, browse the logs (located in the directory /Library/Logs/WindowsServices), display and terminate individual connections, and view a graph of connections over time (see Figure F-6). Similar information is provided for Print Service.
Figure F-6. Server Status: Windows Services

Configuration Details
Underneath the GUI, a lot of activity takes place to offer Windows Services. In the non-Server version of Mac OS X, selecting Windows File Sharing sets the SMBSERVER parameter in /etc/hostconfig and triggers the Samba startup item. In Mac OS X Server, under normal circumstances the Samba startup item and the SMBSERVER parameter are never used.
Instead, a process named sambadmind generates /etc/smb.conf from the configuration specified in Server Settings and Workgroup Manager and handles starting and restarting the Samba daemons as necessary. The sambadmind process is in turn monitored by watchdog, which keeps an eye on certain processes and restarts those which fail. The watchdog utility is configured in /etc/watchdog.conf, a file similar to a System V inittab, which specifies how the services under watchdog's purview are to be treated. For example, the line for sambadmind looks like this:
sambadmin:respawn:/usr/sbin/sambadmind -d # SMB Admin daemon
Using a watchdog-monitored process such as sambadmind to start the Samba daemons, instead of a one-time execution of a startup item, results in more reliable service. In Mac OS X Server, if a Samba daemon dies unexpectedly, it is quickly restarted. (Examples of other services monitored by watchdog are Password Server, Print Service, and the Server Settings daemon that allows remote management.)
There's another wrinkle in Mac OS X Server: the Samba configuration settings are not written directly to /etc/smb.conf, as they are in the non-Server version of Mac OS X. Instead, they're stored in the server's local Open Directory domain,[1] from which sambadmind retrieves them and regenerates smb.conf. For example, the Samba global parameters are stored in /config/SMBServer (see Figure F-7). Share point information is also kept in Open Directory, under /config/SharePoints, while CUPS takes responsibility for printer configuration in /etc/cups/printers.conf (also creating stub entries used by Samba in /etc/printcap).
Figure F-7. NetInfo Manager: SMBServer properties

Table F-1 summarizes the association of Windows Services settings in the Server Settings application, properties stored in Open Directory, and parameters in /etc/smb.conf.
Table F-1: Samba configuration settings in Mac OS X Server
Server Settings graphical element in Windows Services |
Open Directory property in /config/SMBServer |
Samba global parameter in /etc/smb.conf |
General → Server Name |
|
|
General → Workgroup |
|
|
General → Description |
|
|
General → Code Page |
|
|
General → Start Windows Services on system startup |
|
N/A |
Access → Allow Guest Access |
|
|
N/A |
|
|
Access → Maximum client connections |
|
|
Logging → Detail Level |
|
|
Neighborhood → WINS Registration → Off |
|
|
Neighborhood → WINS Registration → Enable WINS server |
|
|
Neighborhood → WINS Registration → Register with WINS server |
|
|
Neighborhood → Workgroup/Domain Services → Master Browser |
|
|
Neighborhood → Workgroup/Domain Services → Domain Master Browser |
|
|
Print → Start Print Service |
|
N/A |
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
|
N/A |
|
N/A |
N/A |
|
|
N/A |
|
N/A |
N/A |
|
N/A |
N/A |
|
N/A |
N/A |
|
N/A |
N/A |
|
N/A |
N/A |
|
N/A |
N/A |
|
N/A |
Rolling Your Own
When making manual changes to the Samba configuration file, take care to block changes initiated from graphical applications by invoking this command:
# chflags uchg /etc/smb.conf
From that point on, the GUI will be useful only for starting, stopping, and monitoring the service--not for configuring it.
If you install your own version of Samba, you can still manage it from Server Settings by changing some of the Open Directory properties in /config/SMBServer.
To do this, open NetInfo Manager and modify the samba_sbindir and samba_bindir properties to match the location of your Samba installation. Optionally, you can modify samba_libdir, samba_vardir, and samba_lockdir. Assuming a default Samba installation, you can also change these at the command line with the following commands:
# nicl . -create /config/SMBServer samba_sbindir /usr/local/samba/bin
# nicl . -create /config/SMBServer samba_bindir /usr/local/samba/bin
# nicl . -create /config/SMBServer samba_libdir /usr/local/samba/lib
# nicl . -create /config/SMBServer samba_vardir /usr/local/samba/var
# nicl . -create /config/SMBServer samba_lockdir /usr/local/samba/var/locks
You can check your settings with this command:
# nicl . -read /config/SMBServer
In Server Settings, select Stop Windows Services, then run this command:
# killall sambadmind
The watchdog utility restarts sambadmind within seconds. Finally, go back to Server Settings, and select Start Windows Services.
If you don't modify Open Directory properties to match your active Samba installation (because you wish to manage your configuration another way), be sure never to activate Windows Services from the Server Settings application, or you'll wind up with two sets of Samba daemons running concurrently.
1. In versions of Mac OS X prior to 10.2, Open Directory domains were called NetInfo domains. NetInfo Manager (located in /Applications/Utilities) provides a graphical interface to view and modify the contents of Open Directory databases. For more information, see the Mac OS X Server Administrator's Guide, as well as Understanding and Using NetInfo, downloadable from the Mac OS X Server resources web page at http://www.apple.com/server/resources.html.
Return to ONLamp.com.