Make Netatalk talk to Leopard (Mac OS X 10.5)

Thursday, October 25. 2007
36 comments
0 trackbacks

After installing Leopard on my MacBook I realized, that I could no longer connect to my media server using AppleTalk. Having configured Netatalk quite often before I found the reason very quick. Leopard seems to require Two-Way Password encryption and won't work without it (if you know about a way to make Leopard connect, please leave it in the comments). Here's how to enable it on Debian Etch and Ubuntu servers.

Unfortunately the required module to enable password encryption on Debian is not in the standard package and needs to be compiled by the user.

First wee need to fetch the source for netatalk:

> apt-get source netatalk

then install all dependencies:

Debian:

> su
> apt-get install devscripts fakeroot libssl-dev cracklib2-dev
> apt-get build-dep netatalk
> exit

Ubuntu:

> sudo apt-get install devscripts fakeroot libssl-dev cracklib2-dev
> sudo apt-get build-dep netatalk

and build netatalk

> cd netatalk-2.0.3
> DEB_BUILD_OPTIONS=ssl debuild

The final step is to install our own build of netatalk

Debian:

> su
> dpkg -i ../netatalk*.deb

Ubuntu:

> sudo dpkg -i ../netatalk*.deb

The new version of netatalk is now running, but you can still not connect from your mac.

First create a .passwd file in the home directories of all users connecting with Leopard

Debian:

> su
> echo userpassword > /home/username/.passwd
> chown username /home/username/.passwd
> chmod 600 /home/username/.passwd

Ubuntu:

> sudo echo userpassword > /home/username/.passwd
> sudo chown username /home/username/.passwd
> sudo chmod 600 /home/username/.passwd

Then restart netatalk

Debian:

> su
> /etc/init.d/netatalk restart

Ubuntu:

> sudo /etc/init.d/netatalk restart

If you did not edit your /etc/netatalk/afpd.conf you should be up an running, by now. If you DID add a line to afpd.conf you nbeed to add the following to -uamlist:

uams_dhx.so

Example:

- -transall -uamlist uams_clrtxt.so,uams_dhx.so -nosavepassword

That's it. You now have an appletalk server thet's leopard compatible AND more secure then before!

by Stefan LH

Comments
Display comments as (Linear | Threaded)

Hi i've been following your instructions but still can't get it to work, I get this error when running DEBBUILDOPTIONS

Now signing changes and any dsc files... signfile netatalk_2.0.3-4.dsc Sebastian Rittau gpg: skipped "Sebastian Rittau ": secret key not available gpg: [stdin]: clearsign failed: secret key not available debsign: gpg error occurred! Aborting.... debuild: fatal error at line 1155: running debsign failed

Any ideas?

#1 Fredrik on 2007-10-25 17:06 (Reply)

I'm not sure. There might be a packet missing, maybe openssl or pgp. I don't know. If anyone finds a solution, please let me know, I want to add it to this entry.

#1.1 BlackMac (Homepage) on 2007-10-25 17:24 (Reply)

Well i got it working, my system was a bit of a mix of stable and testing :-) so i installed a clean etch and now everything's working. I didn't have to create the .passwd file though, and i still get the debsign error

#1.1.1 Fredrik on 2007-10-25 19:40 (Reply)

Fredrik, I (finally) solved this problem by adding the otions "-i -us -uc -b" to debuild

#1.2 didier on 2007-12-29 15:45 (Reply)

Don't worry about that. The .deb files can be signed by the program's author. That way you know it wasn't modified when you try to install it. Since we are modifying the deb, Ubuntu is trying to sign the file as the last step, but it fails because you don't have the key -- you aren't the original author.

All that means is the .deb that was created will not be signed.

Long story short: Ignore that error, the deb will install anyways.

#1.3 Derek Petersen on 2008-03-31 12:00 (Reply)

No luck at all here. It took me forever to get the correct set of reqs to get this to build (it doesn't help that netatalk requires both libcupsys2 and heimdal-dev, whih are listed as conflicting in Apt), but I was finally able to do so. I too got the error concerning the missing private key, but the .deb file is created none-the-less, so I installed it.

Unfortunately, it's still no-go, even with the rest of the suggested modifications. I've had to install Samba until there is some sort of fix. I was running Etch stable, but could only get the deps correct by upgrading it to testing. It also didn't help that build-deps wouldn't complete, and that there was at least one dep (cracklib) that wasn't listed as a dep, but which would kill the build.

A frustrating way to spend my evening, only to have everything finally built and installed, only to not work at all. Sigh.

Yaz.

#2 Brad BARCLAY (Homepage) on 2007-10-27 10:32 (Reply)

It appears you have the exact same problem that i had, unfortunatly i did'nt find any other solution than to reinstall etch and then follow the instructions on this site and here: http://blog.our-files.com/?p=5

#2.1 Fredrik on 2007-10-27 16:43 (Reply)

shouldn't your step "> build-dep netatalk" rather be "apt-get build-dep netatalk"?

and I'd suggest to do a "echo "netatalk hold" | sudo dpkg --set-selections" so that our compiled package isn't overwritten by the package manager later.

#3 bernd on 2007-10-27 23:21 (Reply)

With this you can re-enable cleartext passwords for your account in Leopard:

defaults write -g com.apple.AppleShareClientCore -dict-add afp_cleartext_allow -bool true

That way you don't need to stray from the standard netatak package available in Debian or Ubuntu.

Hope that helps. :-)

#4 Erwin (Homepage) on 2007-10-28 15:11 (Reply)

Actually it seemed the command to activate the clear text password you posted is not for Leopard. A little checking the defaults showed it must be the following:

defaults write com.apple.AppleShareClient afp_cleartext_allow -bool true
#4.1 Stephan on 2007-11-01 00:26 (Reply)

Thank you so much; just wasted about an hour wondering why this didn't work but worked with my Fedora machines.

#4.2 Mitch Haile (Homepage) on 2008-01-14 01:20 (Reply)

This is the blog post I wish I had found before I mucked through all this myself :-)

http://blog.wearesakuzaku.com/94-making-netatalk-work-on-debian-with-leopard/

Erwin, I knew there had to be a way to re-enable cleartext passwords on Leopard, but I had no idea how to discover what the name of the setting was. How did you figure that out?

#5 Cody Robbins (Homepage) on 2007-10-29 11:46 (Reply)

Thanks for the link to that posting, Cody -- it turns out I too was missing libssl-dev. I had to solve the circular dependency problem by running /usr/lib/pbuilder/pbuilder-satisfydepends, and with those two in place, once I re-ran ./configure, it finally reported that it was configured to build the DHX support. I'm finally reconnected to my Linux box. Huzzah!

Yaz.

#5.1 Brad BARCLAY (Homepage) on 2007-10-29 12:26 (Reply)

I was actually browsing through the output of defaults read to see if I would run into anything to adjust the transparency of the menubar when I saw this one. Doing a search with afp_cleartext_allow the first result is a page at macosxhints and at the bottom of that page you can find the needed command.

#5.2 Erwin (Homepage) on 2007-10-29 12:39 (Reply)

Okay, I am almost positive I need this same fix. I don't have the uams_dhx.so file but no matter what I do I can't get the circular dependencies problem resolved. Can you give more detail on how to use the pbuilder command to get both the heimdal-dev and the libkrb5-dev packages installed at the same time? I am truly at a loss now.

Thanks,

kazoo

#5.3 kazooless on 2008-06-25 09:24 (Reply)

Thanks for this.

"sudo build-dep netatalk" should read "sudo apt-get build-dep netatalk"

cheers

#6 Josh on 2007-10-29 22:55 (Reply)

Thank you!

Worked out fantastic!!!

#7 Markus on 2007-10-30 21:04 (Reply)

You are the man, it works and rocks!!! ;-) thanks!

#8 Ricardo Ferro on 2007-11-02 00:32 (Reply)

Anyone happen to have some advice on this error? I get this even if i just try to install the netatalk w/o altering it or anything (sudo apt-get install netatalk).

tarting Netatalk services (this will take a while): nbp_rgstr: Connection timed out Can't register deep-blue:Workstation@* invoke-rc.d: initscript netatalk, action "start" failed. dpkg: error processing netatalk (--install): subprocess post-installation script returned error exit status 1 Errors were encountered while processing: netatalk

Any suggestions would be great, thanks all.

#9 Nomad on 2007-11-02 16:54 (Reply)

Worked like a charm Ubuntu Feisty

#10 Mike Bishop (Homepage) on 2007-11-06 02:54 (Reply)

Maybe it's a good idea to ask ubuntu build team to enable SSL by default in their build?

Any reason to do not? I think netatalk in ubuntu/debian is mostly used by people with macs in their network...

#11 PieterB (Homepage) on 2007-11-06 16:08 (Reply)

ty ty ty! :-) time 4 timemachine :-)

#12 russo. (Homepage) on 2007-11-08 19:00 (Reply)

I'm pretty sure I have Ubuntu configured correctly and netatalk built correctly. I can connect fine to my home directory from Leopard. I have a 2nd drive that I mount as /storage. I added this share to the AppleVolumes.default. When I try to connect to this Leopard just spins and spins. Anyone else have problems connecting to anything besides their home directory?

#13 spencer on 2007-11-12 22:15 (Reply)

I would recommend to delete all the Appletalk and Mac files (like ds_store)

#13.1 BlackMac (Homepage) on 2007-11-12 22:18 (Reply)

Ah ha! Thanks, that worked. I thought I had done that once but apparently I must have missed something. I couldn't figure out why it didn't work after doing a clean install of leopard. It was actually completely hanging the OS, with no choice but to hold down the power button

#13.1.1 spencer on 2007-11-12 22:24 (Reply)

Super! it works really good, but there's one problem i have with netatalk/afpd on ubuntu.. i can see all files on my server except .htaccess files. Does anyone else has this problem or an solution?

:-)

#14 HSL on 2007-11-24 15:07 (Reply)

Hello All,

I have been trying to get my mac book pro running leopard to connect my Fedora Core 7 running Netatalk. It took a little to get Netatalk to compile with the new Berkly DB APIs. I just had to add an additional argument to a stat function pointer. It was pretty straight forward. I don't think it would be the root of my problem. After getting it to build and installing it, I am able to connect to my home directory on my FC7 machine using Netatalk with no problems. However, I am trying to access an external drive mount at /mnt/hd. I have commented out the ~ from my AppleVolumes.default file. I have included a line like this:

/mnt/hd "backup"

With these settings, I am prompted for user and password. So I type in my credentials that are valid on my FC7 box. It then connects me to my home directory every time regardless of how my AppleVolumes.default file is configured. I cannot seem to see what the problem is. The external HD is an hfsplus filesystem. I was thinking that maybe FC7 and Netatalk do not like working with hfsplus filesystems, so I changed my path to something like this:

/home/[user]/shared "backup"

Which is obviously on my local ext3 partition. I still get connected to /home/[user] directory.

Any suggestions?

Thanks for any help, smanders

#15 smanders on 2007-11-30 05:54 (Reply)

Thank you.

It works like a charm!

I suggest you to add a version on the debian/changelog file (or use dch -i) to prevent accidental upgrades.

#16 xuzo on 2008-01-29 10:45 (Reply)

I was following the steps literally without understanding a lot of it. I need some extra explanation of the comment about uams_dhx.so. Where is the line into which I need to add it? In what file? I don't think I typed such a line as a top level command. ???

#17 Paul Condon on 2008-03-01 05:39 (Reply)

OK, sorry for the dumb question. I found the line, when I decided to go ahead and add some needed lines to afpd.conf even though I had no idea where this -transall ... line was to be found.

Thanks for instructions so simple that even doopy me can follow them!

#18 Paul Condon on 2008-03-01 06:15 (Reply)

Hi there, I'm having serious problems to connect to Netatalk on a MyBook World Edition NAS. Netatalk is up and running, howecer I cannot connect, nor as guest or a specific user. I get these messages in a log:

Mar 18 21:35:08 mybookmeus daemon.info afpd[9044]: ASIP session:548(5) from 192.168.2.9:49721(7)
Mar 18 21:35:08 mybookmeus daemon.info afpd[9044]: login noauth
Mar 18 21:35:08 mybookmeus daemon.info afpd[9044]: login nobody (uid 99, gid 99) AFP3.1
Mar 18 21:35:10 mybookmeus daemon.info afpd[9044]: logout nobody
Mar 18 21:35:10 mybookmeus daemon.info afpd[9044]: 0.10KB read, 0.08KB written
Mar 18 21:35:10 mybookmeus daemon.info afpd[8115]: server_child[1] 9044 done
Mar 18 21:35:22 mybookmeus daemon.info afpd[9046]: ASIP session:548(5) from 192.168.2.9:49723(7)
Mar 18 21:35:22 mybookmeus daemon.info afpd[8115]: server_child[1] 9045 exited 1
Mar 18 21:35:22 mybookmeus daemon.info afpd[8115]: server_child[1] 9046 done
Mar 18 21:35:29 mybookmeus daemon.info afpd[9047]: ASIP session:548(5) from 192.168.2.9:49725(7)
Mar 18 21:35:29 mybookmeus daemon.info afpd[9047]: dhx login: arandil
Mar 18 21:35:29 mybookmeus daemon.info afpd[9047]: 0.18KB read, 0.12KB written
Mar 18 21:35:29 mybookmeus daemon.info afpd[8115]: server_child[1] 9047 done
Mar 18 21:35:42 mybookmeus daemon.info afpd[9060]: ASIP session:548(5) from 192.168.2.9:49726(7)

I added the .passwd-file to a shared folder (because there is no user on the NAS), forced cleartext on Leopard but now I'm stuck. I'm more than willing to post all the .conf's that are needed! Can someone please help me, this is driving me nuts...

PS: Tiger cannot connect either

#19 Dimitri Meus on 2008-03-19 15:24 (Reply)

Haven't tried this myself... but check out the com.apple.AppleShareClient.plist file under 'Macintosh HD:Users:[your user shortname]:Library:Preferences'

There is a setting there 'afp _ cleartext _ allow' which defaults to 'no'. Try changing it to 'Yes'.

-Cheers, Peter.

#20 Peter B on 2008-05-01 18:20 (Reply)

Why go through the hassle of recompiling yourself (especially if you are not familiar with the steps involved in Debian package compiling):

Just read the README.Debian file below /usr/share/doc/netatalk and see how you can add an APT line to subscribe to unofficial pre-compiled package made by the official netatalk package maintainer.

...which happens to be me ;-)

  • Jonas

P.S.

If you have any complaints or suggestions for improvements, you are most welcome to throw them at me: install the package reportbug and run "reportbug netatalk" on the commandline).

Don't just expect me to stumble across your random notes spread across the internet :-P

#21 Jonas Smedegaard (Homepage) on 2008-06-29 14:17 (Reply)

Thank you very much. This solved my partially-related issue of getting Netatalk to work again after upgrading to Ubuntu 8.04 Hardy. I appreciate people that post clear, concise, and well-presented guides like this.

#22 Nick on 2008-07-18 15:42 (Reply)

Worked great for me! Thanks for the well-written directions.

#23 Kiel on 2008-08-03 06:48 (Reply)

Great guide.

First go didn't work for me on a fresh Ubuntu 8.10.

Kept getting a "Connection Failed" error on my mac.

I ended up finding some good info that complements this post at: http://www.blackmac.de/archives/58-Make-Netatalk-talk-to-Leopard-Mac-OS-X-10.5.html

To solve the problem I basically had to install some additional packages (as referred to a comment in the above linked post) and re-install.

Packages were libssl0.9.8-dbg, libpam0g, libpam0g-dev, libpam-cracklib.

I also added come additional options to build, specifically: DEBBUILDOPTIONS=ssl dpkg-buildpackage -rfakeroot -i -us -uc -b

dunno which one thing solved it but it is all good now. (Ubuntu 8.10 + Mac Leopard)

#24 Ben on 2008-11-03 12:59 (Reply)

Add Comment

You can use [geshi lang=lang_name [,ln={y|n}]][/lang] tags to embed source code snippets
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Markdown format allowed