Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

User can login as admin, but lost sudo

In a nutshell, my problem is this: I can login as admin, and I can make some admin changes (e.g. setting the date and time), but other permissions (anything that requires sudo) are inaccessible and/or corrupted. Is there a way to restore sudo to accept a password I provide? I don't much mind if it no longer matches the admin login password as long as I know what it is.


Illustration:

$ sudo ls

Password:

Sorry, try again.

Password:

Sorry, try again.

Password:

Sorry, try again.

sudo: 3 incorrect password attempts

$


I am quite certain I failed to make a typo in at least one of those attempts to enter the password. 😝


Miscellaneous:

- I have two admin accounts - one that I use, and one that was originally for another person. Neither of us remembers the password on the second admin account. I also have a standard account that I use for day-to-day stuff.

- The libraries I updated immediately before the problem occurred were libxml2 (2.9.1), libpng (1.6.6), and libz (1.2.8). (see background)

- I have the OS X 10.5 install DVD.

- I do not have a backup drive for Time Machine to restore the system from.

- I have hidden files and folders set to display in Finder.


Background:

I recently tried updating some libraries on my iMac in order to build some open source image editing/processing software packages. I'm pretty sure something I did screwed stuff up in the process, and I can't seem to put things back the way they were as sudo no longer accepts my password. I tried rebooting. I can still log into the admin account, but I seem to be working with only a subset of admin privileges. At the same time, several other apps stopped working properly. For instance, I tried running ClamXav antivirus software, but it finishes without scanning any files, giving the following errors:


LibClamAV Error: cli_cvdload: Corrupted CVD header

LibClamAV Error: Can't load /usr/local/clamXav/share/clamav/daily.cvd: Malformed database

ERROR: Malformed database


I am able to connect to the WiFi in my office, but I cannot log in to get internet access. That may be unrelated, but it did not manifest until the reboot, so I am a bit suspicious. I have not yet tried lugging my iMac back home, where I have a little more control over the WiFi, but I'd prefer to first try stuff that does not require physically moving my computer. My best speculation is that it's all library shenanigans, and once I get the libraries back to their former versions, stuff will work again, but I'm kinda stuck without sudo.

iMac, Mac OS X (10.5.8)

Posted on Nov 11, 2013 6:49 PM

Reply
10 replies

Nov 12, 2013 10:22 AM in response to z-min

Could be many things, we should start with this...


"Try Disk Utility


1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.

2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)

*Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*

3. Click the First Aid tab.

4. Select your Mac OS X volume.

5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."


http://docs.info.apple.com/article.html?artnum=106214


Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.


(Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive & clear caches.)


If that doesn't help, you can reinstall the OS & your data should be fine once back upto 10.5.8


Or, try changing the PW for the other admin account...


1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.


2. When your computer finishes starting up from the disc, choose Utilities from the Installer menu at the top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)


Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access the Menubar at top.


1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.

2. When your computer finishes starting up from the disc, choose Reset Password from the Installer menu at the top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)

Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Reset Password.

Nov 13, 2013 1:47 PM in response to BDAqua

Thanks for you reply, BDAqua, but it looks like the install disc method isn't going to work so well. See below.


When I got my iMac, it had 10.4.10 on it, with the 10.5.0 upgrade DVD packaged with it, along with the 10.4.10 install DVDs. I tried holding down the C key at startup with both the 10.4.10 install disc and the 10.5.0 upgrade disc. In both cases the DVD ejected, and reboot continued normally. At no point did the computer boot from disc.


On the bright side, I was able to change the login password for the second admin user in System Preferences > Accounts, but sudo doesn't work for that user, either. So I know I've got some important admin capacities that still work.


I tried opening Disk Utility on the install DVD via Finder. It froze - wouldn't quit without a force quit. I tried opening Disk Utility in /Applications/Utilities/. Same hangup. This is not what I have experienced with Disk Utility on this computer in the past.


Some other symptoms:

Activity Monitor shows no processes whatsoever, and the only tabs showing any kind of data are CPU and Disk Usage. System Memory, Disk Activity, and Disk Usage show the templates, but everything is blank. This behaviour also started at the same time as my other issues, with the updated libraries.


I can view the system.log in Console. It is reporting frequent crashes of mdworker. E.g.


Nov 13 13:13:07 z-min-2 ReportCrash[4460]: Formulating crash report for process mdworker [4462]

Nov 13 13:13:07 z-min-2 com.apple.launchd[1] (0x10b470.mdworker[4462]): Exited abnormally: Bus error

Nov 13 13:13:07 z-min-2 ReportCrash[4460]: Saved crashreport to /Library/Logs/CrashReporter/mdworker_2013-11-13-131306_z-min-2.crash using uid: 0 gid: 0, euid: 0 egid: 0

Nov 13 13:13:12 z-min-2 ReportCrash[4465]: Formulating crash report for process mdworker [4463]

Nov 13 13:13:12 z-min-2 com.apple.launchd[1] (0x10b470.mdworker[4463]): Exited abnormally: Bus error

Nov 13 13:13:12 z-min-2 ReportCrash[4465]: Saved crashreport to /Library/Logs/CrashReporter/mdworker_2013-11-13-131311_z-min-2.crash using uid: 0 gid: 0, euid: 0 egid: 0


And repeating essentially the same three lines every 5 seconds or so. Console is also noting some crashes at 10-second intervals of a program that requires internet access, but as the computer is currently without internet, that could just be indirectly related.

Nov 15, 2013 2:28 AM in response to BDAqua

Ah, no, I had not tried Safe Boot. I misread that as belonging to the previous set. Same hangup with the Disk Utility application as I had running it from normal boot. I left it alone for about ten minutes, but it still got nowhere and wouldn't close without force quit.


Adding all drives to Spotlight's privacy pane stopped mdworker from reporting crashes every five seconds. The crashing resumed a few minutes after I took them back off that list. So from what I understand, I'm guessing that means that whatever was indexed by Spotlight before I played with fire libraries is searchable, but nothing new can be indexed.


Most of my important files are already backed up, so unless there are some other bright ideas, I think I'll try re-installing the OS some time next week when I'm not as busy with other things.

Dec 19, 2013 5:33 AM in response to BDAqua

My apologies for not responding more quickly to this - I forgot my password for here. >_>


I was able to resolve my issues. I got a copy of DiskWarrior and the Snow Leopard install disc. DiskWarrior did not fix the problem. Installing Snow Leopard over my messed up Leopard system DID fix the problem. There are some new issues with the system sometimes being laggy, but I think that might be due to having only 2GB of RAM. At least I know what my next hardware purchase will be.

Dec 19, 2013 7:57 AM in response to z-min

I am not sure if it has been mentioned but it is important to backup anything that is important to you on another disk before you try anything else. I usually back up my whole disk with the last free version of Carbon Copy Cloner but if you don't have storage for all this at least backup home folders etc.


My main maintenace/repair tool is the free AppleJack which I use in auto mode with:


applejack AUTO shutdown


You could create new accounts and see if they are any better but if not it may be best to do a clean install and type in preferences etc rather than transfer anything during the install as this may perpetuate the problem. Backup first though.

User can login as admin, but lost sudo

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.