Currently Being ModeratedAug 3, 2013 7:13 AM (in response to vijayfromvic)
Welcome to the forums.
It's unusual that a password change led to a missing or corrupt administrator account, short of direct modifications made to the underlying LDAP database that went awry, or some low-level corruption(s) of LDAP or related. If the LDAP database is corrupt, all bets are off. If you're looking at and entering commands from sites such as the one you've linked to, then you're working in areas of the Unix environment that can lead to these sorts of problems.
It's unfortunately too late now, but when you're making changes at this level, it's usually advisable to have a backup or two available, and a recovery disk. That's the easiest path back out, if (when?) mistakes happen, or if (when?) LDAP gets corrupted either on its own, or due to some errant changes. Roll in those backups created from before the changes or, if those backups aren't available, create a new backup from another system and try and reinstall OS X, and start over. Your Mac is new enough to have Internet recovery available.
If things are particularly dire and a straight reinstall doesn't work, then wipe the disk and reinstall OS X.
⌘S is the sequence for single-user mode and that should work for this case. (Unless the boot disk is corrupted.)
Target Disk Mode would be one approach for getting a backup, if there's no administrative access and no working bootstrap. Use another (working) Mac to get the backup.
Currently Being ModeratedAug 3, 2013 11:45 AM (in response to vijayfromvic)
It's best to have more than one admin account when messing around. Create other accounts and mess with them.
Shutdown your machine. Hold down the command + s key. Poweron.
Notice that I hold down command + s then I power on the machine.
it's hold down the command key the press and hold down the s key.
create a new admin id.
Get the Mac to set up an additional administrative account. You can then change the password on your old account.
Start with your computer power off. Hold down command-s. Power on your computer.
Type in the following:
The first two commands will depend on your release of Mac OS X. Look at what is typed out in the console to determine the exact format.
# Type the follow two instructions to access the startup disk in read/write. Press return after each command.
# in case of partial success repeat this command until errors go away.
/sbin/mount -uw /
#List all files. The l is a lower case L.
#The move command acts as a rename command in this format.
mv -i .applesetupdone .applesetupdone.old
# reboot your mac
shutdown -r now
Once you've done that the computer reboots and it's like the first time you used the machine. Your old accounts are all safe. From there you just change all other account passwords in the account preferences!!
Limnos adds detailed explainations:
The above the idea came from a post by JoseAranda at September 9, 2006 3:48 AM
You will need to scroll down to see this post. Search for applesetupdone
This method is mentioned in an apple support page without giving an explanation.
Once you have a new administrative account, you can change the password of your old administrative account
blue apple > System Preferences > Accounts