Samba For Mac Server



  1. Smb Mac Server
  2. Windows Samba Share
  3. Samba Linux
  4. Samba Server On Windows

Overview

Samba runs on most Unix, OpenVMS and Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple's macOS Server, and macOS client (Mac OS X 10.2 and greater). Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well. In order to use Samba 4's included Kerberos and NetBios servers we need to first disable the ones that ships with Lion. # launchctl unload /System/Library/LaunchDaemons/com.apple.Kerberos.kdc.plist # launchctl unload /System/Library/LaunchDaemons/com.apple.netbiosd.plist # ln -s /opt/local/samba/private/krb5.conf /etc/krb5.conf.

This tutorial will walk you through connecting your Macs to SMB (Server Message Block) shares, hosted on Windows Servers, Windows Desktops, or network attached storage devices.

Mac

Mac OS X allows you to connect to different network shares using the Connect to Server utility. Although this tutorial covers SMB, it can be used for other protocols too.

Before you begin, make sure you have your NetID login account details before attempting to connect!

Launch Connect to Server

  1. From the Finder menu, click Go.
  2. Click Connect to Server from Go’s drop down menu.
  3. Alternatively, you can also press Command+K to launch Connect to Server.

Connect to a SMB Share

  1. In the Server Address field, enter smb:// to define the network protocol for SMB, and then enter either the IP address or the hostname of the server.

    FIG 2 – Connect to Server dialog box
  2. To add the server to your Favorite Servers list, click the ‘+’ button.
  3. Click Connect to connect to the share.
  4. When prompted, enter your NetID user name and password to connect to server.
  5. Click Connect to connect to the server.
  6. Violà! Once the connection is made, the share you have access to will appear on your desktop.

    FIG 4 – Mounted share volume in OS X
Samba for mac server settings

Setup Procedures

The first thing to note is that the procedure described in Chapter 2 using System Preferences to enable Samba doesnot apply to Mac OS X Server. Unlike Mac OS X, the Sharing pane ofSystem Preferences does not include an option to turn on Windows FileSharing. Instead, there is a set of applications to configure,activate, and monitor services: Workgroup Manager, Server Settings,Server Status, and Open Directory Assistant, all located in thedirectory /Applications/Utilities.

NOTE

In addition to being installed with Mac OS X Server, these and otheradministrative applications are included on a separate installationCD-ROM sold with the operating system. They can be used to manage MacOS X Server systems remotely from any Mac OS X machine.

For more information, refer to the Mac OS X ServerAdministrator'sGuide, included as a PDFfile in the /Library/Documentation/MacOSXServerdirectory, and also downloadable from AppleComputer's web site at http://www.apple.com/server/.

Briefly, the procedure for setting up SMB file and printer shares isas follows:

  1. Designate share points in Workgroup Manager for file sharing.

  2. Set up print queues in Server Settings for printer sharing, andactivate Printer Service.

  3. Configure and activate Windows Services in Server Settings.

  4. Activate Password Server and enable SMB authentication in OpenDirectory Assistant.

  5. Enable Password Server authentication for user accounts in WorkgroupManager.

  6. Monitor file and print services with Server Status.

Sharing Files

On the right, under the General tab, check the box labeled Share thisitem and its contents, change the ownership and permissions ifdesired, then click the Save button. Next, under the Protocols tab,select Windows File Settings from the pop-up menu, and ensure thatthe box labeled Share this item using SMB is checked. At this point,you can also decide whether to allow guest access to the share,change the name of the share displayed to SMB clients, or setpermissions for files and folders created by SMB clients. Click theSave button when you're finished making changes. SeeFigure F-1.

Figure F-1. Workgroup Manager: Share Points and Windows File Settings

Samba For Mac Server

Sharing Printers

Printer shares are set updifferently. First, launch Server Settings; under the File &Print tab, select Print, then Configure Print Service.. Check thebox labeled Automatically share new queues for Windows printing.Next, click the Print icon again and then Show Print Monitor. Makesure the printers you want to share are listed. Printers directlyattached to the server should have queues created automatically, butremote printers you wish to reshare must be added by clicking NewQueue and discovering or specifying the printers. Whenyou're finished, click Save, select the Print iconone more time, and select Start Print Service. See Figure F-2.

Figure F-2. Server Settings: Print Service

Samba For Mac Server

TIP

Server Settings will make local printers available for sharing onlyif they're PostScript compatible. Unfortunately,many printers, including consumer-grade USB inkjet printers,aren't. If you want to make one of these printersavailable to SMB clients, you can still add the share to/etc/smb.conf yourself with a text editor. See'Rolling Your Own' later in thischapter for instructions and caveats related to making manual changesto smb.conf.

Configuring and Activating Services

At this point, neitherthe file shares nor the printer shares are available to SMB clients.To activate them, click the Windows icon in Server Settings, andclick Configure Windows Services.. Under the General tab, you canset the server's NetBIOS hostname, the workgroup orWindows NT domain in which the server resides, and the descriptionthat gets displayed in a browse list. You can also specify the codepage for an alternate character set. Finally, you can enableboot-time startup of Samba. See Figure F-3.

Figure F-3. Server Settings: Windows Services

Password Server

When you've finished configuring Windows Services,click the Save button, then click the Windows icon in ServerSettings, and select Start Windows Services. This starts the Sambadaemons, enabling access from SMB clients.

Activating Password Server

To enable Password Server or merely check its settings, start theOpen Directory Assistant. Unless you wish to change any of thesettings, just click the right arrow button in the lower-right cornerof the window until you get to the first Security step. At thispoint, activate Password Server by selecting the option markedPassword and authentication information will be provided to othersystems. The next step displays the main administrative account, andthe one after that gives you a choice of authentication protocols toenable (see Figure F-4). Make sure that SMB-NT ischecked, and check SMB-Lan Manager if you have Windows 95/98/Me orolder clients. The final step saves the Password Server configurationand prompts you to reboot.

Figure F-4. Password Server authentication protocols

Enabling Password Server

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

Figure F-5. Workgroup Manager: Enabling Password Server authentication

Monitoring Services

Once you've goteverything working, you'll want to keep an eye onthings. The Server Status application gives you views into thevarious 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 andterminate individual connections, and view a graph of connectionsover time (see Figure F-6). Similar information isprovided for Print Service.

Figure F-6. Server Status: Windows Services

Configuration Details

There's another wrinkle in Mac OS X Server: theSamba configuration settings are not written directly to/etc/smb.conf, as they are in the non-Serverversion of Mac OS X. Instead, they're stored in theserver's local Open Directory domain,[1] from which sambadmind retrieves themand regenerates smb.conf. For example, the Sambaglobal parameters are stored in/config/SMBServer (see Figure F-7). Share point information is also kept in OpenDirectory, under /config/SharePoints, while CUPStakes responsibility for printer configuration in/etc/cups/printers.conf (also creating stubentries used by Samba in /etc/printcap).

Smb Mac Server

Figure F-7. NetInfo Manager: SMBServer properties

Table F-1 summarizes the association of WindowsServices settings in the Server Settings application, propertiesstored 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

netbios_name

netbios name

General → Workgroup

workgroup

workgroup

General → Description

description

server string

General → Code Page

code_page

client code page

General → Start Windows Services on system startup

auto_start

N/A

Access → Allow Guest Access

guest_access, map_to_guest

map to guest

N/A

guest_account

guest account

Access → Maximum client connections

max_connections

max smbd processes

Logging → Detail Level

logging

log level

Neighborhood → WINS Registration →Off

WINS_enabled, WINS_register

wins support

Neighborhood → WINS Registration →Enable WINS server

WINS_enabled

wins support

Neighborhood → WINS Registration →Register with WINS server

WINS_register, WINS_address

wins server

Neighborhood → Workgroup/Domain Services→ Master Browser

Local_Master

local master

Neighborhood → Workgroup/Domain Services→ Domain Master Browser

Domain_Master

domain master

Print → Start Print Service

printing

N/A

N/A

lprm_command

lprm command

N/A

lppause_command

lppause command

N/A

lpresume_command

lpresume command

N/A

printer_admin

printer admin

N/A

encryption

encrypt passwords

N/A

coding_system

coding system

N/A

log_dir

N/A

No covers out of this kid. Otis for mayor. She sings all day,' Jason said. Just could not be bothered to listen or talk.' Like Otis, his younger sister has also developed an interest in music.' 'And all originals.

N/A

smb_log

log file

N/A

nmb_log

N/A

N/A

samba_sbindir

N/A

N/A

samba_bindir

N/A

N/A

samba_libdir

N/A

N/A

samba_lockdir

N/A

N/A

samba_vardir

N/A

N/A

stop_time

N/A

Windows Samba Share

Rolling Your Own

Footnotes

Samba Linux

[1] In versions of Mac OS X prior to 10.2, Open Directory domainswere called NetInfo domains. NetInfo Manager (located in/Applications/Utilities) provides a graphicalinterface to view and modify the contents of Open Directorydatabases. For more information, see the Mac OS X ServerAdministrator's Guide, as well asUnderstanding and Using NetInfo, downloadablefrom the Mac OS X Server resources web page at http://www.apple.com/server/resources.html.

Samba Server On Windows

TOC