Lion and legacy AFP connections

I have just upgraded to Lion to find out that I could no longer connect to my Qnap NAS via the AFP protocol. Seems like Apple decided to disable an authentication mechanism in Lion which the Qnap device depends on. Whenever I tried to connect with my username, I received an error “There was a problem connecting to the server”.

Qnap is working on an updated firmware but my device will not receive this update, so I need another solution.

Thanks to Alexander Wilde there is a simple solution to reenable the now missing authentication schema.

Open up the Terminal app, enable write access to /Library/Preferences and change a setting for AppleShareClient:

sudo chmod o+w /Library/Preferences
sudo defaults write /Library/Preferences/com.apple.AppleShareClient afp_host_prefs_version -int 1

Now reboot the computer and try to connect to the AFP share. There will still be an error, but now Lion has updated the AppleShareClient plist file and we can enable the old authentication mechanism and remove the write permission from the Preferences folder:

sudo defaults write /Library/Preferences/com.apple.AppleShareClient afp_disabled_uams -array "Cleartxt Passwrd" "MS2.0" "2-Way Randnum exchange"
sudo chmod o-w /Library/Preferences

After another reboot, the AFP shares are now working again.

To reset the setting, just use:

sudo defaults write /Library/Preferences/com.apple.AppleShareClient afp_disabled_uams -array-add "DHCAST128"

Leave a Reply