Samba For Mac Os X



Setup Procedures

  1. Apple Mac OS X connect to SMB (samba/CIFS) share. Go Connect to Server. Smb://servername/sharename (in this case, acfiles is 10.1.16.112 currently).
  2. In Mac OS X 10.9 Apple is introducing support for SMBv2. They are also making SMB the standard protocol for Mac to Mac and Mac to Windows file transfers. AFP is being deprecated and will only be used when transferring files between clients 10.8 and below. Mac OS X 10.0 to 10.6 used the open source Samba package for SMB support.
  3. I have had nothing but trouble with SMB (Windows Sharing) services in Mac OS X Server 10.7. These problems were supposedly solved in 10.7.3, but my particular issues seem to still be there in several cases (Windows XP name browsing not working, Guest access not working, performance issues, dropped connections), and may be related to the Windows XP (versus Windows Vista/7) clients I'm dealing with.
  4. Since OS X 10.7 Lion update, network integration with Ubuntu is a nightmare. Previously we could print on OSX printers and mount OSX file shares in a snap, using SMB/CIFS. Now I got to print on OSX Lion printers using CUPS and IPP sharing.

A Samba password, which must first be obtained by clicking on the Samba Access link on the respective system's Webtools page below. The Samba password, separate from the RCI or Eden password, will be sent to the account owner's e-mail address. From the Mac OS X Toolbar click on the Go menu and select Connect to server. The Connect To Server.

Samba for mac os x 10.7

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.

Samba

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

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.

Mac Os Samba Server

Figure F-2. Server Settings: Print Service

TIP

Samba For Mac Os XClient

Smb 1.0 Mac Os X

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).

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

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

Rolling Your Own

Footnotes

Samba

[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.

TOC

A brief howto on installing Samba 4 alpha18 on OS X Lion (non-server). **Incomplete**

  • 1Dependencies
  • 3Setting up Samba 4

Dependencies

Install MacPorts using the instructions on macports.org.

Bind 9 with Dynamic Updates

Edit the Portfile in MacPorts to build Bind 9.9.0 for Samba 4 dynamic updates. The file is located at /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/net/bind9/Portfile

Then install bind9 and other dependencies

Compiling, Installing and Provisioning

You can use Git as in general guide, or you may prefer to use releases:

Since MacPorts installs Bind 9.9.0, we have to make a small change in source4/dns_server/dlz_minimal.h

And we can go ahead with compiling Samba 4.

Setting up Samba 4

Kerberos

In order to use Samba 4's included Kerberos and NetBios servers we need to first disable the ones that ships with Lion. Execute the following commands

Configure DNS

For some reason bind looks for a so extension instead of a dylib. We can patch this up with a quick link.

There are some other things to tweak before bind9 will start properly.

Samba Server Mac Os X

Now you can add the following lines to include Samba's dynamic updates (in file /opt/local/etc/named.conf)

and add these two lines in the 'options' section

Management with Launchd

Building a PortFile

Notes

Retrieved from 'https://wiki.samba.org/index.php?title=Samba4/OSX&oldid=12383'