Fix Remote Desktop’s “Authentication Failed” error—remotely!

One of the most frustrating things about Apple Remote Desktop is the “authentication failed” errors that pop up from time to time. You’ve got your user name and password right, but for some reason, the client machine just won’t recognize you.

I got the dreaded “authentication failed” error after upgrading one client machine to version 3.2.2, and so I patched together a solution that allows you to solve the problem remotely, using our good friend SSH. It’s all Terminal window commands, but it’s straightforward enough that most users should be comfortable doing it.

Step 1: SSH to the uncooperative client.
You can do this via local IP address:

$ ssh [admin username]@[client machine IP address]

Or over Bonjour if a) you don’t know the IP, or b) your router assigns IPs dynamically.

$ ssh [admin username]@[client machine name].local

If you’ve never connected with SSH before, you’ll have to type “yes” before you enter your admin user password when the “Password” prompt comes up.

My machines are all named after deadly sins, so when I do this, it looks like the screenshot below. “Lust” is the computer I’m using, “Wrath” is the remote machine that’s giving me the “authentication failed” error when I try to connect to it using Remote Desktop.

login.png

Notice how the computer name listed before “cosmo” has now changed from “Lust” to “Wrath”. Be sure that when you enter any Terminal commands described on this page other than ssh, you’re entering them on the remote machine, not the machine you’re running ARD from. If you don’t pay attention, you could end up deleting a bunch of files that are working just fine.

Step 2: Kill ARD on the remote machine. Once you’re connected to the client, type the command top. This opens activity monitor, listing all the processes currently running on the remote machine. Note the process ID numbers of “ARDAgent” and “AppleVNCServer”, along with ‘ARDHelper” if it shows up.
login.png

Once you’ve identified those numbers, open a new Terminal window, SSH to the remote machine again, and then force quit these process by typing kill followed by their process ID number (“PID”).

$ kill 234
$ kill 233

Terminal might whine about quitting ARDHelper because it’s being run by root, but use the sudo command or the bang-bang trick to force the process into submission.

$ sudo kill 228

Step 3: Delete the offending files. As far as I can tell, the whole reason the “authentication failed” error comes up is bad data or bad file paths in the Remote Desktop plist files. It might be possible to fix them with a text editor, but I prefer a less fussy solution: delete them.

Double-check to make sure you’re SSHed into your remote machine, and enter the following Terminal commands, one at a time:

$ rm -rf /var/db/RemoteManagement
$ rm /Library/Preferences/com.apple.RemoteDesktop.plist
$ rm ~/Library/Preferences/com.apple.RemoteDesktop.plist
$ rm -r /Library/Application\ Support/Apple/Remote\ Desktop/
$ rm -r ~/Library/Application\ Support/Remote\ Desktop/

Step 4: Fire ARDAgent back up. Now that you’ve quit the processes and deleted the old stuff, change directories to the ARDAgent folder, then turn everything back on and recreate the plist files. You can do this by entering the following two commands:

$ cd /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/
$ sudo ./kickstart -activate -configure -access -on -users username -privs -all -restart -agent -menu

Step 5: Reconnect to the client machine using Remote Desktop. Re-open Remote Desktop on your computer and go to the Scanner. It won’t remember the name of the old machine, but it will still detect it and list its IP address. Double-click that machine, enter your admin name and password, and your dominion over it should now be restored, all without getting out of your chair.

  • Tom Lawton

    Hmmm.. Hoped this would be the fix for me, but no…

    A couple of questions-
    Why don’t you use the kickstart command to shut down ARD/VNC at the beginning?
    Would ps auxc|grep ARD; ps auxc|grep VNC be easier than watching top..?

    Wonder what else to delete to get this client alive..? 30 other machines are fine.. just this latest one playing up…

  • http://www.ccnbi.com Mark Seamans

    I have had this happen when the local user loads up a vnc server. Removing the vnc server software does the trick. In my case, I could still run unix command/copy/install apps just fine, I just couldn’t control/observe.
    Good write up. Sure, experienced linux/unix guys have quicker ways than using “top” but to each their own.

  • Phil98

    Thank you for the post.
    I will try this but I don’t think it will solve the problem for me.
    I’ll let you know if this works but I feel that the “Authentication Failed” error is a deeper problem than that …

    Here is my experience :
    I have a mix of macs to remote control (older ones, new ones, PPC, Intel, …).
    Everything was functioning perfectly until I upgraded all machines to 3.2.2 and used the “Admin” to remotely install a customized ARD client on all computers.
    The install succeeded but from that very moment only a few computers stopped responding and were giving the “Authentication Failed” error. (They were also not showing the correct frontmost application in the list).
    I tried almost everything to solve this problem when I noticed that the “not-responding” Macs were all PPC based computers !!! All the Intel ones were not affected at all by this problem.
    So I think it is really a bug with the 3.2.2 update.

    Today I am still facing that problem and I think I will have no other choice than reinstall OS X on the PPC based Macs …

  • JD

    I wasn’t ever able to kill the parent ARDAgent. It just kept popping up in the PID list (incrementing by 10). So, I kept going with the steps and it failed with the same annoying authentication failure.

    Curiously, I NEVER get this error running Mac OS X Server 10.5.7…just the client OS.

    :-(

    Booooo!

  • Blue

    I’m having the exact problem you describe on a PowerPC G5 running OS X Server 10.5.8. And the same problem that JD had trying to kill the processes.

    I can connect to the server fine from my MacBook Pro, but I’m getting the Authentication Failed error from my Mac Pro. (Both running OS X 10.5.8.)

    My problem in trying to follow these steps is that I can’t shut down ARDAgent and I can’t shut down AppleVNCService. A second or two after I enter “Kill 2541” (for example), the service pops back on the “top” display. I tried doing the same thing from the server itself using Activity Monitor to Quit the processes, but they pop back up a second later.

    Any thoughts on how to kill the thing?

  • http://www.dev-corp.com Jim Geldermann

    OSX Server 10.5.8
    ARD 3.3.2

    Could screen share with VNC, but not ARD or ScreenSharing. ARD browser should logged in and could log in with AFP.

    Only AppleVNCServer active, ARD services were not active.

    Killed VNC.

    Kickstarted ARDagent

    Can now screen share with AR and VNC.

  • Moose

    I found this worked but with the following addition:

    On the ARD admin computer that connects to the clients open the following .plist preference file using Property List Editor (from the Developer tools)

    ~/Users/’username’/Library/Preferences/com.apple.RemoteDesktop.plist

    Search for the problem client machine’s entry in the ComputerDatabase item and delete it. You will now have to re-add the client to ARD management application, but authentication should work.

    Also,

    re:

    “I wasn’t ever able to kill the parent ARDAgent. It just kept popping up in the PID list (incrementing by 10). So, I kept going with the steps and it failed with the same annoying authentication failure.”

    I found this happened if RemoteManagement was still enabled in the Sharing Preferences. If this was switched off I could kill the processes and they stayed off. Then re-enable it after the kickstart.

  • Peter

    I had this “authentication failed” error while doing a Lion minor upgrade to my server (10.7.1?) and got it fixed using your information. Thanks VERY much!