TweetFollow Us on Twitter

Integrating OS X With OpenLDAP/Samba, Part 1

Volume Number: 24
Issue Number: 11
Column Tag: Network Administration

Integrating OS X With OpenLDAP/Samba, Part 1

Configuring Your Mac To Work With Linux Samba and LDAP Servers

by Noah Gift

Introduction

OS X is an incredible machine, of course, if you are reading this magazine, I didn't need to tell you that. It has arguably, the finest User Interface ever known to man, yet it has a beautiful Unix engine purring under the hood. OS X Server also has a somewhat forward thinking User Interface for managing the raw power of true Unix, as it elegantly hides the real world complexity of dealing with things like Apache and Open LDAP.

While OS X Server is certainly a fine piece of engineering, it might interest many to know, that configuring OS X to talk to a Linux infrastructure is fairly straightforward. I still remember fondly, when parts of OS X had to be altered, in an undocumented way, just to get it to work perfectly with Linux and Unix systems, but many of those problems have disappeared over the years. Virtualization, Leopard, and the further enhancement of Linux, has created a very opportune moment for OS X/Linux relations.

In this article, we explore the basics of getting started with using Samba hosted on a Linux Virtual Machine. Future articles will get deeper into Open LDAP/Samba integration.

Talking Virtually

As I mentioned earlier, virtualization has eased the difficulty of working with Linux. One of the reasons is that, in some respects, the Linux Operating System has become like a document that you open and close. If someone writes a great template for an invoice or resume in Microsoft Word, or iWork Pages, then you simply open the file, and fill in the blanks.

With the current advances in virtualization a Linux operating system can be almost as easy to work with as Microsoft Word. For a recent book I wrote, we released a free, as in beer, Ubuntu 7.10 virtual machine that is pre-configured with OpenLDAP and Samba. You can download it here, start it with VMWare Fusion, and then just play it:

http://examples.oreilly.com/9780596515829/vm/

The username and password for everything on the virtual machine is py4sa, including the Samba service we will use in this article.

Getting To Know Samba

If you are on old Mac guy or gal, you may be more familiar with AFP, or Apple File Protocol, than with Samba. Briefly, Samba is Open Source/Free software that has been around since 1992, and it enables File and Print sharing over the SMB/CIFS protocol. SMB originated with Microsoft as a network sharing protocol for Windows.

Samba is pre-installed on OS X and you can easily create a samba share on your Mac by simply selecting File Sharing under Sharing in System Preferences, as seen in the screenshot:


Figure 1: Sharing

In our case, though, we are going to use virtualization to talk to a share we create inside of the virtual machine we downloaded, so instead of serving the share, our Mac will be the client.

Firing Up A Virtual Machine

If you downloaded the Virtual Machine you should perform the following steps to make sure you get up to speed to follow the rest of the article. If you have problems with the virtual machine networking, or don't want to download a 500MB file, don't worry, because in a later article we go into detail about how to configure this from scratch. Note, you will need to have a copy of VMWare fusion to follow along.

Step 1: Start the Virtual Machine

Step 2: Once running, log in with py4sa as the username and password

Step 3: Double check that samba started by typing at the shell:

sudo /etc/init.d/samba 

Step 4: Ensure Network Is Working by typing at shell

ifconfig

Here is a screenshot of what this looks like a successfully running virtual machine:


Figure 2: Verifying VM Is Working Properly

Creating A Linux Samba Share On A VM

If you performed the previous steps and everything working, the rest is just as easy. We can simply edit the samba configuration file and add a share for us to connect to. To do this just edit this file: /etc/samba/smb.conf with vim, or your favorite text editor, and add these lines to the bottom:

Listing 1: Adding lines to /etc/samba/smb.conf

[share]
path = /usr

Next, just restart the samba service so it rereads the config file by typing in:

sudo /etc/init.d/samba restart

Now simply browse to the share PY4SA, by creating a new Finder window, as shown in the figure below and authenticating. If you follow along with the steps below you will be able to obtain Read Only Access to the /usr directory on the virtual machine.


Figure 3: Logging in to a Samba share


Figure 4: Authenticating to the share


Figure 5: Read Only Access Trying To Create Directory In Share

Notice, as shown in Figure 5 above, that if you try to create a file onto the share you get an access privileges error. We only have Read Only access! This is because of the extremely basic configuration for [share] we set up. If you are brave, feel free to dig into the smb.conf and fix the problem. Otherwise, next month we go all out on creating a realistic permission structure for an Enterprise or a Home. For now, just getting a virtual server up and running, and then connecting to it is a good stride.

Conclusion

In this article, we began to think about how a virtualized Linux infrastructure might make sense for OS X clients. We created a one way, Read Only connection to an Ubuntu Linux virtual machine via a SMB share we created ourselves.

In the next article we dig in deep and configure LDAP and Samba to work together, create a realistic share permission structure, and authenticate our Mac's directory to a Linux LDAP server, as well as get familiar with managing LDAP through various native and foreign tools.

BIBLIOGRAPHY AND REFERENCES

Noah Gift. "How To Build A Dirt Easy NAS with Samba". Red Hat Magazine, http://www.redhatmagazine.com/2007/06/26/.

Noah Gift. Getting Started With Open Directory. O'Reilly. http://www.macdevcenter.com/pub/a/mac/2007/06/01/discover-the-power-of-open-directory.html

Noah Gift and Jeremy Jones. Python For Unix and Linux Systems Administration. O'Reilly. ISBN: 0596515820


Noah Gift has been a Mac user since his family bought a Macintosh Performa 6300 in 1992, and started connected to BBS networks immediately and then eventually the World Wide Web in 1993 when it become open to the public. He is the co-author of Python For Unix and Linux System Administration by O'Reilly, and the upcoming Google App Engine In Action by Manning.

Noah has a couple of decades of experience in the television and film industry starting off as an editor for ABC Network News as a teenager. He contributed to the first feature animated film for Disney Feature Animation and Sony Imageworks. He also had stints at Turner Studios and Caltech, where he worked for the Nobel Prize winning President as a Mac expert. He has a Master's degree in CIS, and is LPI and ACSA certified. He also organizes PyAtl, the local Python programmers user group in Atlanta.

Currently Noah is consultant, writer and speaker, specializing in OS X/Unix, Linux, Python, and Web development for his company, GiftCS, www.giftcs.com. Many of his projects and writing are available at www.noahgift.com. He can be contacted at noah.gift@giftcs.com

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

iExplorer 4.1.10 - View and transfer fil...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more
iExplorer 4.1.10 - View and transfer fil...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more
Adobe InCopy CC 2018 13.0.1.207 - Create...
InCopy CC 2018 is available as part of Adobe Creative Cloud for as little as $19.99/month (or $9.99/month if you're a previous InCopy customer). Adobe InCopy CC 2018, ideal for large team projects... Read more
Microsoft Office 2016 15.40 - Popular pr...
Microsoft Office 2016 - Unmistakably Office, designed for Mac. The new versions of Word, Excel, PowerPoint, Outlook and OneNote provide the best of both worlds for Mac users - the familiar Office... Read more
Adobe InDesign CC 2018 13.0.1.207 - Prof...
InDesign CC 2018 is available as part of Adobe Creative Cloud for as little as $19.99/month (or $9.99/month if you're a previous InDesign customer). Adobe InDesign CC 2018 is part of Creative Cloud.... Read more
Apple iOS 11.1.2 - The latest version of...
iOS 11 sets a new standard for what is already the world’s most advanced mobile operating system. It makes iPhone better than before. It makes iPad more capable than ever. And now it opens up both to... Read more
Slack 2.9.0 - Collaborative communicatio...
Slack is a collaborative communication app that simplifies real-time messaging, archiving, and search for modern working teams. Version 2.9.0: Slack now officially, and fully, supports Japanese.... Read more
iExplorer 4.1.9 - View and transfer file...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more
PCalc 4.5.3 - Full-featured scientific c...
PCalc is a full-featured, scriptable scientific calculator with support for hexadecimal, octal, and binary calculations, as well as an RPN mode, programmable functions, and an extensive set of unit... Read more
iExplorer 4.1.9 - View and transfer file...
iExplorer is an iPhone browser for Mac lets you view the files on your iOS device. By using a drag and drop interface, you can quickly copy files and folders between your Mac and your iPhone or... Read more

Latest Forum Discussions

See All

Mighty Battles guide - how to build a so...
Mighty Battles, the latest title from Hothead Games, is set to take the App Store by storm. The game puts a welcome twist on lane battlers, adding FPS elements to spice things up a bit. You'll collect cards to put your own military unit to gether,... | Read more »
Rules of Survival guide - how to be the...
The PUBG craze makes its way to mobile, with more and more battle royale games debuting on iOS and Android. Rules of Survival joins the ranks of mobile PUBG-likes, offering a classic battle royale experiences that doesn't vary too much from its... | Read more »
The best new games we played this week -...
The weekend is upon us friends, and it's time to take a look back and reflect on all of the wonderful games we've played over the past few days. This week was jam packed with new releases. There were some big, long awaited launches, some fun... | Read more »
Lineage II: Revolution guide - tips and...
At long last, Lineage II: Revolution has now come to western shores, bring Netmarble's sweeping MMORPG to mobile devices. It's an addictive, epic experience, but some of the systems in the game can be a bit overwhelming. Here are a few tips to help... | Read more »
A Boy and His Blob (Games)
A Boy and His Blob 1.0 Device: iOS Universal Category: Games Price: $4.99, Version: 1.0 (iTunes) Description: | Read more »
Fight terrible monsters and collect epic...
Released on Western markets early last month, Dragon Project, created by Japanese developer COLOPL, brings epic monster hunting action to mobile for the very first time. Collect a huge array of weapons and armor, and join up with friends to fight... | Read more »
I Am The Hero (Games)
I Am The Hero 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: I Am The Hero is a pixel art, beat 'em up, fighting game that tells the story of a "Hero" with a glorious but mysterious past.... | Read more »
Kauldron (Music)
Kauldron 1.0 Device: iOS Universal Category: Music Price: $3.99, Version: 1.0 (iTunes) Description: Kauldron is our warmest sounding, punchiest synth yet! A completely new modeling technology, combined with carefully designed... | Read more »
Lineage II: Revolution is mobile’s bigge...
NCSoft’s hit fantasy MMORPG series has just made the leap to mobile with the help of Netmarble in Lineage II: Revolution. With over 1.5 million players having already pre-registered ahead of the game’s launch, Revolution hit the app stores... | Read more »
Swing skilfully in new physics-based pla...
Sometimes it’s the most difficult of obstacles that can be the most rewarding. One game hoping to prove this is OCMO, the new tough but fair platformer from developers Team Ocmo. Primed to set every speedrunner’s pulse racing, as an otherworldly... | Read more »

Price Scanner via MacPrices.net

Best Apple iPad deals this weekend, up to $80...
Apple resellers are offering 9.7″ iPads and 10.5″ iPad Pros for up to $80 off MSRP this weekend as part of their early Holiday and Black Friday sales: Adorama is offering new 2017 9.7″ 32GB WiFi... Read more
Early Black Friday sale: Apple iMacs for up t...
B&H Photo has 27-inch iMacs in stock and on sale for up $130-$150 off MSRP including free shipping. B&H charges sales tax in NY & NJ only: – 27″ 3.8GHz iMac (MNED2LL/A): $2149 $150 off... Read more
Apple restocks refurbished Mac minis starting...
Apple has restocked Certified Refurbished Mac minis starting at $419. Apple’s one-year warranty is included with each mini, and shipping is free: – 1.4GHz Mac mini: $419 $80 off MSRP – 2.6GHz Mac... Read more
Save on 12″ MacBooks, Apple refurbished model...
Apple has Certified Refurbished 2017 12″ Retina MacBooks available for $200-$240 off the cost of new models. Apple will include a standard one-year warranty with each MacBook, and shipping is free.... Read more
Early Holiday sale: 12″ iPad Pros for up to $...
B&H Photo has 12″ iPad Pros on sale today for up to $130 off MSRP. Shipping is free, and B&H collects no sales tax outside NY & NJ: – 12″ 64GB WiFi iPad Pro: $749, save $50 – 12″ 256GB... Read more
Holiday sale prices on Apple 13″ MacBook Pros...
B&H Photo has 2017 13″ MacBook Pros in stock today and on sale for $100-$150 off MSRP, each including free shipping plus NY & NJ sales tax only: – 13-inch 2.3GHz/128GB Space Gray MacBook Pro... Read more
Sale: 13″ MacBook Airs starting at $899, $100...
B&H Photo has 2017 13″ MacBook Airs on sale today for $100 off MSRP including free shipping. B&H charges NY & NJ sales tax only: – 13″ 1.8GHz/128GB MacBook Air (MQD32LL/A): $899, $100 off... Read more
Week’s Best Deal on 13″ MacBook Pros: Apple r...
Apple has a full line of Apple Certified Refurbished 2017 13″ MacBook Pros available for $200-$300 off MSRP. A standard Apple one-year warranty is included with each MacBook, and shipping is free.... Read more
Deal: 15″ 2.6GHz MacBook Pro for $1799 w/free...
B&H Photo has clearance 2016 15″ 2.6GHz Touch Bar MacBook Pros in stock today and available for $600 off original MSRP. Shipping is free, and B&H charges NY & NJ sales tax only: – 15″ 2.... Read more
Black Friday pricing on the 1.4GHz Mac mini....
MacMall has the 1.4GHz Mac mini on sale for $399 including free shipping. Their price is $100 off MSRP (20% off), and it’s the lowest price for available for this model from any reseller. MacMall’s... Read more

Jobs Board

Product Manager - *Apple* Pay on the *Appl...
Job Summary Apple is looking for a talented product manager to drive the expansion of Apple Pay on the Apple Online Store. This position includes a unique Read more
*Apple* Pro/Consumer Apps Support Engineer -...
…exemplify AppleCare's expert technical support paired with exceptional customer service for Apple 's software apps. This person is a problem solver, who understands Read more
Partner Marketing Manager, *Apple* Pay - Ap...
Job Summary The Apple Pay partner marketing team is looking for a Marketing Manager to develop and drive US programs. The right candidate will be passionate about Read more
*Apple* Solution Consultant - Apple (United...
# Apple Solution Consultant - Rochester, MN Job Number: 113037950 Rochester, MN, Minnesota, United States Posted: 19-Sep-2017 Weekly Hours: 40.00 **Job Summary** Are Read more
Sr. Experience Producer, Today at *Apple* -...
# Sr. Experience Producer, Today at Apple Job Number: 56495251 Santa Clara Valley, California, United States Posted: 23-Jun-2017 Weekly Hours: 40.00 **Job Summary** Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.