Icon

Networking Windows with Mac OS X, Part 2

Don't be afraid of the big bad smb.conf

In part one of this tutorial, Dave Nagel introduced you to the magical world of Jaguar's native Windows file sharing, for those of us that are forced to interact with one (or, heaven forbid, more than one) Windows machine(s) on a daily basis. For many, that's as much or more than you'll ever need in order to make your beloved Mac a good corporate citizen, but for those who demand a few more options than Uncle Steve decided to include by default, don't fret. With the help of some freeware, you can easily set a bunch of hidden settings to truly make your Mac just another faceless node in the vast machine of Windows boxen on your network. That is, if you're into that sort of thing.

A Little History

The Windows sharing feature bundled with Jaguar, fortunately, isn't some proprietary piece of code thrown in by Apple engineers. Much like the open source Apache web server that Apple includes in OS X and calls Web Sharing, OS X's Windows sharing is actually the open source Samba server, which has been freely available to our Linux/Unix brethren for many moons now. About a year ago, I had a Linux friend of mine help me in downloading, compiling, installing and configuring the latest build of Samba through the terminal, which, for me, was a great exercise in discovering for myself how NOT to spend my time in OS X, but it did the job of getting my OS X machine integrated into our Windows network. A short time later, preconfigured OS X Samba packages began showing up on various Samba development sites, which eased the job considerably. Now that Jaguar is in the picture, the Samba installation headache is all but gone. And while the core functionality of Samba sharing is there, Apple, by default, only lets you get at a small portion of its potential through the System Preferences panel. So for those who want more, you'll need to learn to love the smb.conf file.

Step 1: Read Part One

Now, before you get all scared that I mentioned some obscure Unix configuration file as being your new Windows sharing best friend, go back and read part one of this tutorial. I promise you, part two won't get any more complicated than part one, but I'm also assuming that you've read part one, because we're just going to keep on keeping on from there.

Step 2: Download the Samba Sharing Package

Fire up your browser of choice, and point it at http://xamba.sourceforge.net/ssp/index.shtml. This is the home of the freeware Samba Sharing package, a combination application and Preference Pane that gives you GUI access to OS X's smb.conf file. I'm patient. I'll wait while you do this.

NOTE: Pre-Jaguar users, you're in luck. Download the older version of the Samba Sharing Package from the above link, as well as Samba X (the Samba server itself), which is available at http://xamba.sourceforge.net/sambax/index.shtml. Once you install the Samba X package and restart your machine, you'll be able to join in on the Windows sharing fun with all the Jaguar folks.

Step 3: Install the Preference Pane

Once you unstuff the Samba Sharing Package file, you should see a folder that looks like Figure 1. Drag the folder to your Applications folder (or wherever else you like to put your programs). Now drag the SambaSharing.prefpane to your /Users/yournamehere/Library/PreferencePanes folder to install the Samba pane into your System Preferences panel. If you don't have a PreferencePanes folder in your home directory already, just make a new folder, name it PreferencePanes, and then move the SambaSharing.prefpane over.


Figure 1

Step 4: Launch the System Preferences panel.

I assume you know where this can be found. Once the panel is open, you'll see a handy Samba Sharing icon sitting there amongst all the other System Preferences (fig 2). Go ahead, click on it. You'll see four tabs: Global, Connections, Configurations, and Extras (fig 3). Basically, these panels control and monitor the status of the server, who's connected to your machine, what configuration or profile you're running, etc. This stuff is all pretty straightforward, so we'll move on and set up some shares so others on your network can see the parts of your system drive(s) you want them to.


Figure 2


Figure 3

Step 5: Make Your Configuration

Here's where the actual Samba Sharing Package application comes in. Click on the configurations tab, and then click New to create a new configuration. It'll ask you what you want to name your configuration (I named mine Home), then automatically launch the Samba Sharing Package program.

DISCLAIMER: Look, I'm not an IT professional. I'm just a guy with a Windows machine I needed to make talk to my Mac. I've got a two-machine setup, so security is of minimal concern, since I'm only sharing stuff with myself. The steps I'm going to walk you through are for my particular setup, and I can't speak to the relative security or insecurity of what I'm doing. So remember that IT staff you fired after reading part one of this tutorial? Hire 'em back to help you through setting up the particulars of your shares to work within the rules of your specific environment.

With that out of the way, let's go through the tabs in the Samba Sharing Package to get things workin'. The SSP opens by default on the Server tab (fig 4). The Servername is what your machine will be known as on the Windows network; for me, I entered Snake. The Comment field can be left blank if you want, but you can certainly choose to enter something descriptive here to further identify your machine on the Windows network. The Workgroup field is where you enter either the Workgroup you're on (in my case, Springfield), or the NT/2000 Domain you're a part of. I left the WINS Server field blank, since I don't have a WINS server, but some networks do. Again, get this from your IT staff you had to sheepishly hire back.


Figure 4

Let's move on to the Global tab (fig 5). Here, you can set whether you want to map the Guest Account to any of the accounts on your Mac (in my case, the "windows" user I set up specifically for Windows Sharing; if you did what you were supposed to and read part one of this tutorial, you'll have a similar account), what network interfaces to allow access, whether those annoying "dot files" are visible to connected users, settings to allow or deny specific hosts, etc. Fill these in as you see fit, but you can also leave the defaults here as well if you don't want to deal with it.


Figure 5

The Shares tab (fig 6) is the real meat of the program. Here, you define what folders or drives are visible to Windows users on your network. Click New, which prompts you to name your share. Don't forget to enclose your share name in brackets, or it won't work. After naming your share, fill in a comment if you like, then click the Edit Folder button to browse to the drive or folder you want shared. Now, the important part. The Change Permissions button is there for a reason, allowing you to set the appropriate rights to the folder you want to share. The nice part is that the SSP app lets you do this completely in context (fig 7), so go ahead and tweak the permissions to allow or disallow the appropriate access to your share. Once you're done with that, check the Writeable and Guest Access boxes as desired, and viola: your first share! Repeat this step as necessary; in my case, I just duplicated the first share and changed the name and folder, saving me a few steps since all my shares are configured identically. You can also opt to share printers, as well as share (or not share) the default user directory that's shared in the basic setup described in part one of this tutorial.


Figure 6


Figure 7

The Textual tab (fig 8) shows you the actual smb.conf file. There are a bunch of other parameters that the Samba server recognizes that are not represented elsewhere in the Samba Sharing Package application, so if you want to enter any of these (provided, of course, you know what they are), you can do it directly in this panel. For example, I manually entered "create mode=777" at the end of each of my shares, because I wanted every file to be read, written, and potentially executed by any user, since any user means me and me alone in my setup. Once you're done playing with all of the tabs and have everything where you want it, save the configuration file (File->Save) and quit the Samba Sharing Package.


Figure 8

Step 6: Activate Your Configuration and Restart the Server

Your System Preferences panel should still be open and displaying the Samba Sharing pane. Click on the Global tab if you're not there already, and use the drop-down menu to select the configuration you just made, in my case, "Home." (fig 9) This works very similarly to the Location drop-down in the Network pane, so mobile users can have different sharing configurations saved to reflect the various Windows networks they participate in regularly. If the server is already running, press the Stop button, wait for the server to shut down, then click the Start button to reactivate the server with your new settings. Please note that any change you make, either in the preference pane or the Samba Sharing Package application, requires you to restart the server for the changes to take effect.


Figure 9

Step 7: Check to See If It's Working

Painful as this step may be, you have to do this part from a Windows machine. From the Windows desktop, double-click on the Network Neighborhood icon, choose Entire Network, and find the Workgroup or Domain your machine is supposed to be a part of. Hopefully, if all is well, you'll see the name of your Mac sitting amongst all the other Windows machines (fig 10). Double-click on your machine to see if your shares show up (fig 11). Everything OK? Great! Windows users can now grab and send files to and from your Mac just like they do amongst themselves. Plus, you can keep track of who is currently connected to your Mac from the preference pane's Connections tab (fig 12), and kick them to the curb through the Disconnect button when and if they start getting too uppity.


Figure 10


Figure 11


Figure 12

Playing nice with the Windows world is a necessary evil these days, especially in the corporate environment, but fortunately, Jaguar is more than up to the task. Hopefully, after following these steps, your Mac will appear as just another Windows machine sitting nicely on the network, giving the higher-ups one less reason to take your Mac away. Happy Samba serving!

^ Top of Page

Got Feedback? to send an email. I'll do my best to answer. Really.