TweetFollow Us on Twitter

MacEnterprise: Understanding SMB in OS X

Volume Number: 23 (2007)
Issue Number: 08
Column Tag: Networks

Understanding SMB in OS X

There are many more pieces than you may realize

By Philip Rinehart, Yale University

SAMBA

This month, the MacEnterprise community has been talking about Samba, and how OS X uses it, both on Server and Client. It's a bit of an interesting topic, as both use a version of Samba, 3.0.10, that is slightly out of date, as the current version of Samba shipping is 3.0.25a. It is interesting to note that the Finder does not primarily use the underlying samba framework, but instead uses mount_smbfs, a command from the FreeBSD project instead. First let's look at this particular command.

Mount_SambaFS

Mount_smbfs is a bit of an oddity. It appears to have been included in OS X to take advantage of OS X frameworks. It is linked heavily to the CoreFoundation framework in particular. It also allows for Kerberos authentication, which has only recently appeared in Samba 3.0 or higher. Its usage is pretty simple, and follows the same syntax, both in the Finder and from the command line. In fact, when connecting via the Finder to a share, the command appears in the process list when initiating the connection. Here is the command as it appears in the process list.

/sbin/mount_smbfs -o noautomounted -o browse //user:**************@sambashare /Volumes/sambashare

Let's look at this command a bit further; note the two options used with the -o switch. Neither of these options appear in the manual page for the command. Omit the two options, and the command appears as invoked from the command line. Why is that important to know? It is important, because often many users use smbclient to connect to the Samba share and assume that smbclient behaves in the same way. Now that you know that the Finder uses mount_smbfs, it may or may not be an effective way to test Samba connectivity. If testing the connection via the Finder, use mount_smbfs. Unfortunately, it does not provide as much debugging information as smbclient does.

Another source of frustration for some users is OS X, by default, uses encrypted passwords when connecting to a Samba share. In fact, an Apple knowledge base article, 301580, exists that describes the creation of a configuration file, nsmb.conf, which allows clear text authentication. It should be noted that a file can be created per user as well, .nsmbrc. Let's look at a short example:

[default]
workgroup=WORKGROUP
# this is the server name and ip
[WINDOWS]
address=192.168.1.130
[WINDOWS:USERNAME]
password=my_password

By putting this file in a user's home directory the Samba share will be mounted automatically using the stored password. Note that the password should be stored in encrypted format. To generate the encrypted password, use smbutil. Here's how:

smbutil crypt my_password

Include this in the nsmbrc file, and the Finder will no longer ask for authentication. That pretty much sums up the way that OS X client connects to Samba shares. The Server side is the source of most other common problems.

WINDOWS File Shares

Now that we understand how a client connects to file shares, are there any particular hints for dealing with Windows file shares? Sure, here are some that should be considered:

OS X client cannot connect to a Windows 2003 server if the server has the "digitally sign communication" option enabled. Disable this option to allow a successful connection. The Finder usually will show an Error -5000. It is commonly known as "SMB Signing". For more information on this option, refer to the Microsoft Knowledge Base article, http://support.microsoft.com/kb/887429.

Shares created on a Windows file share generally work most successfully when the user connects with "Full permissions" on the file share. Without full permissions, the Finder may not display any file or folder in the share point.

SAMBA

Let's move to a frequently discussed topic, the use of Samba as implemented on OS X. One of the commonly discussed issues is the use of an older version of Samba, version 3.0.10, in OS X. Samba is also compiled in a particular way, and may not include modules that are required. Recently, a method for recompiling certain modules appeared on the MacEnterprise list. If this is of interest, search the list archives, as the procedure is fairly complex.

Another oddity with Samba is that it does not respect the use of ctime. Why is this relevant? Consider the possibility of controlling backups of files, if the ctime is being used to control whether the file is backed up or not, the inability of Samba to set the ctime could become a problem.

Next, when using Samba in conjunction with Active Directory, check the smb.conf file for the following entries:

Use spnego=yes
Realm=Ad.realm.name
Security=ads

Though generally not an issue any more in Tiger server, when joining a machine to Active Directory and hosting Samba file services via OS X in earlier versions, these options were not consistently set.

Lastly, when using Samba, on server or client, the log level can be tuned. The following entry can be added to the /etc/smb.conf file:

   
log level = [1-10]

Turning up the log level can be very useful when debugging a troublesome connection. At a level of 10, the logging can be quite a handful to parse through, but it may better point to the source of the connection problem.

Windows PRINTING

The last issue that is somewhat common is connecting to a shared Windows printer from OS X. Usually the printer is shared as a "Guest" printer by the Windows machine. However, when printing, an "NT_STATUS_ACCESS_DENIED" error message is returned. OS X does not work without credentials when printing to a Windows shared printer. The most successful method of connecting works by adding the printer using the URI formatted this way:

smb://user:password@DOMAIN/1.2.3.4/Printername

Sometimes adding this via the Printer Setup Utility will work, sometimes not. If it does not work, using the CUPS web interface at http://localhost:631 will allow the printer to be added. It has the additional benefit of being able to print a test page!

In a heterogeneous world, understanding Samba and Windows file and print sharing is a complex and sometimes difficult operation. Often, the configuration or the tools that we have talked about may provide a solution. Until next month, see you on the lists!


Philip Rinehart is co-chair of the steering committee leading the Mac OS X Enterprise Project (macenterprise.org) and is the Lead Mac Analyst at Yale University. He has been using Macintosh Computers since the days of the Macintosh SE, and Mac OS X since its Developer Preview Release. Before coming to Yale, he worked as a Unix system administrator for a dot-com company. He can be reached at: philip.rinehart@yale.edu. The MacEnterprise project is a community of IT professionals sharing information and solutions to support Macs in an enterprise. We collaborate on the deployment, management, and integration of Mac OS X client and server computers into multi-platform computing environments.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »

Price Scanner via MacPrices.net

Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more
Every version of Apple Pencil is on sale toda...
Best Buy has all Apple Pencils on sale today for $79, ranging up to 39% off MSRP for some models. Sale prices for online orders only, in-store prices may vary. Order online and choose free shipping... Read more
Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more
Apple is offering significant discounts on 16...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more
Apple HomePods on sale for $30-$50 off MSRP t...
Best Buy is offering a $30-$50 discount on Apple HomePods this weekend on their online store. The HomePod mini is on sale for $69.99, $30 off MSRP, while Best Buy has the full-size HomePod on sale... Read more
Limited-time sale: 13-inch M3 MacBook Airs fo...
Amazon has the base 13″ M3 MacBook Air (8GB/256GB) in stock and on sale for a limited time for $989 shipped. That’s $110 off MSRP, and it’s the lowest price we’ve seen so far for an M3-powered... Read more
13-inch M2 MacBook Airs in stock today at App...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more

Jobs Board

*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
*Apple* Software Engineer - HP Inc. (United...
…Mobile, Windows and Mac applications. We are seeking a high energy Senior Apple mobile engineer who can lead and drive application development while also enabling Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.