Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

haravikk

macrumors 65832
Original poster
May 1, 2005
1,503
25
Encountered this strange error today for the first time. I have a few commands I run regularly via sudo, and one just completed and I wanted to re-run it, but got the following error:

sudo: unable to cache user root, already exists

I've run these commands a hundred times with no issue, it's really just a simple one-way rsync copying data from a folder to a remote server (as a temporary solution until I can automate it), but has to be run as sudo to avoid permissions issues.

Anyway, now that this error has appeared I can't run anything as sudo, every combination of sudo options that I try returns the above error. I've tried repairing permissions and restarting to no avail. I still appear to have admin rights as far as OS X is concerned, I just don't have access to anything that runs via sudo in the Terminal.

Not sure if it might be related, but I've also noticed some oddities recently, namely I've been getting warnings that I'm running an application downloaded from the internet, even though I had the exact same version of the program open only the day before, like whatever database tracks that has been corrupted.

Does anyone know what cache sudo is referring to, and how I might recreate it?
 
I haven't been able to discover the cause of the problem, but I have found a solution. I was able to fix it by running the command:
Code:
sudo -k
This revokes all sudo permissions and requires you to re-enter your password the next time sudo is used, but doesn't itself require a password. Presumably this destroys any cached credentials, thereby resolving the problem in my case, which must have been a leftover file somewhere.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.